Ignore:
Timestamp:
May 5, 2011, 5:36:53 AM (14 years ago)
Author:
Dmitry A. Kuminov
Message:

trunk: Merged in qt 4.7.2 sources from branches/vendor/nokia/qt.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/src/gui/styles/qstylesheetstyle.cpp

    r769 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
     
    10661066        }
    10671067    }
    1068     if (!hasNativeBorder() && (flags & Border)) {
     1068    if (hasBorder() && (flags & Border)) {
    10691069        const int *b = border()->borders;
    10701070        r.adjust(-b[LeftEdge], -b[TopEdge], b[RightEdge], b[BottomEdge]);
     
    13531353            p->setBrush(br, bg->brush);
    13541354        p->setBrush(QPalette::Window, bg->brush);
     1355        if (bg->brush.style() == Qt::SolidPattern) {
     1356            p->setBrush(QPalette::Light, bg->brush.color().lighter(115));
     1357            p->setBrush(QPalette::Midlight, bg->brush.color().lighter(107));
     1358            p->setBrush(QPalette::Dark, bg->brush.color().darker(150));
     1359            p->setBrush(QPalette::Shadow, bg->brush.color().darker(300));
     1360        }
    13551361    }
    13561362
     
    25382544        QPalette::ColorGroup group;
    25392545    } map[3] = {
    2540         { PseudoClass_Active | PseudoClass_Enabled, QPalette::Active },
     2546        { int(PseudoClass_Active | PseudoClass_Enabled), QPalette::Active },
    25412547        { PseudoClass_Disabled, QPalette::Disabled },
    25422548        { PseudoClass_Enabled, QPalette::Inactive }
     
    31713177                    QRect r(gr.topLeft(),
    31723178                            slider->orientation == Qt::Horizontal
    3173                                 ? QPoint(hr.x()+hr.width()/2, gr.y()+gr.height())
    3174                                 : QPoint(gr.x()+gr.width(), hr.y()+hr.height()/2));
     3179                                ? QPoint(hr.x()+hr.width()/2, gr.y()+gr.height() - 1)
     3180                                : QPoint(gr.x()+gr.width() - 1, hr.y()+hr.height()/2));
    31753181                    subRule1.drawRule(p, r);
    31763182                }
     
    31853191                }
    31863192
    3187                 handleSubRule.drawRule(p, grooveSubRule.boxRect(hr, Margin));
     3193                handleSubRule.drawRule(p, handleSubRule.boxRect(hr, Margin));
    31883194            }
    31893195
     
    34593465    case CE_RadioButton:
    34603466    case CE_CheckBox:
    3461         rule.drawRule(p, opt->rect);
    3462         ParentStyle::drawControl(ce, opt, p, w);
    3463         return;
    3464 
     3467        if (rule.hasBox() || !rule.hasNativeBorder() || rule.hasDrawable() || hasStyleRule(w, PseudoElement_Indicator)) {
     3468            rule.drawRule(p, opt->rect);
     3469            ParentStyle::drawControl(ce, opt, p, w);
     3470            return;
     3471        } else if (const QStyleOptionButton *btn = qstyleoption_cast<const QStyleOptionButton *>(opt)) {
     3472            QStyleOptionButton butOpt(*btn);
     3473            rule.configurePalette(&butOpt.palette, QPalette::ButtonText, QPalette::Button);
     3474            baseStyle()->drawControl(ce, &butOpt, p, w);
     3475            return;
     3476        }
     3477        break;
    34653478    case CE_RadioButtonLabel:
    34663479    case CE_CheckBoxLabel:
     
    40824095        QRenderRule subRule = renderRule(w, opt, pe1);
    40834096        if (subRule.bg != 0 || subRule.hasDrawable()) {
    4084             //We test subRule.bg dirrectly because hasBackground() would return false for background:none.
     4097            //We test subRule.bg directly because hasBackground() would return false for background:none.
    40854098            //But we still don't want the default drawning in that case (example for QScrollBar::add-page) (task 198926)
    40864099            subRule.drawRule(p, opt->rect);
     
    42704283        }
    42714284    break;
     4285
     4286    case PE_FrameMenu:
     4287        if (rule.hasDrawable()) {
     4288            // Drawn by PE_PanelMenu
     4289            return;
     4290        }
     4291        break;
    42724292
    42734293    case PE_PanelMenuBar:
Note: See TracChangeset for help on using the changeset viewer.