diff options
Diffstat (limited to 'src/widgets/styles/qcommonstyle.cpp')
-rw-r--r-- | src/widgets/styles/qcommonstyle.cpp | 121 |
1 files changed, 2 insertions, 119 deletions
diff --git a/src/widgets/styles/qcommonstyle.cpp b/src/widgets/styles/qcommonstyle.cpp index 68d80931f6..b2b1d3fec5 100644 --- a/src/widgets/styles/qcommonstyle.cpp +++ b/src/widgets/styles/qcommonstyle.cpp @@ -460,9 +460,6 @@ void QCommonStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, Q } p->restore(); break; - case PE_Q3DockWindowSeparator: - proxy()->drawPrimitive(PE_IndicatorToolBarSeparator, opt, p, widget); - break; case PE_IndicatorToolBarSeparator: { QPoint p1, p2; @@ -3571,69 +3568,6 @@ void QCommonStyle::drawComplexControl(ComplexControl cc, const QStyleOptionCompl } break; #endif // QT_NO_GROUPBOX -#ifndef QT_NO_WORKSPACE - case CC_MdiControls: - { - QStyleOptionButton btnOpt; - btnOpt.QStyleOption::operator=(*opt); - btnOpt.state &= ~State_MouseOver; - int bsx = 0; - int bsy = 0; - if (opt->subControls & QStyle::SC_MdiCloseButton) { - if (opt->activeSubControls & QStyle::SC_MdiCloseButton && (opt->state & State_Sunken)) { - btnOpt.state |= State_Sunken; - btnOpt.state &= ~State_Raised; - bsx = proxy()->pixelMetric(PM_ButtonShiftHorizontal); - bsy = proxy()->pixelMetric(PM_ButtonShiftVertical); - } else { - btnOpt.state |= State_Raised; - btnOpt.state &= ~State_Sunken; - bsx = 0; - bsy = 0; - } - btnOpt.rect = proxy()->subControlRect(CC_MdiControls, opt, SC_MdiCloseButton, widget); - proxy()->drawPrimitive(PE_PanelButtonCommand, &btnOpt, p, widget); - QPixmap pm = standardIcon(SP_TitleBarCloseButton).pixmap(16, 16); - proxy()->drawItemPixmap(p, btnOpt.rect.translated(bsx, bsy), Qt::AlignCenter, pm); - } - if (opt->subControls & QStyle::SC_MdiNormalButton) { - if (opt->activeSubControls & QStyle::SC_MdiNormalButton && (opt->state & State_Sunken)) { - btnOpt.state |= State_Sunken; - btnOpt.state &= ~State_Raised; - bsx = proxy()->pixelMetric(PM_ButtonShiftHorizontal); - bsy = proxy()->pixelMetric(PM_ButtonShiftVertical); - } else { - btnOpt.state |= State_Raised; - btnOpt.state &= ~State_Sunken; - bsx = 0; - bsy = 0; - } - btnOpt.rect = proxy()->subControlRect(CC_MdiControls, opt, SC_MdiNormalButton, widget); - proxy()->drawPrimitive(PE_PanelButtonCommand, &btnOpt, p, widget); - QPixmap pm = standardIcon(SP_TitleBarNormalButton).pixmap(16, 16); - proxy()->drawItemPixmap(p, btnOpt.rect.translated(bsx, bsy), Qt::AlignCenter, pm); - } - if (opt->subControls & QStyle::SC_MdiMinButton) { - if (opt->activeSubControls & QStyle::SC_MdiMinButton && (opt->state & State_Sunken)) { - btnOpt.state |= State_Sunken; - btnOpt.state &= ~State_Raised; - bsx = proxy()->pixelMetric(PM_ButtonShiftHorizontal); - bsy = proxy()->pixelMetric(PM_ButtonShiftVertical); - } else { - btnOpt.state |= State_Raised; - btnOpt.state &= ~State_Sunken; - bsx = 0; - bsy = 0; - } - btnOpt.rect = proxy()->subControlRect(CC_MdiControls, opt, SC_MdiMinButton, widget); - proxy()->drawPrimitive(PE_PanelButtonCommand, &btnOpt, p, widget); - QPixmap pm = standardIcon(SP_TitleBarMinButton).pixmap(16, 16); - proxy()->drawItemPixmap(p, btnOpt.rect.translated(bsx, bsy), Qt::AlignCenter, pm); - } - } - break; -#endif // QT_NO_WORKSPACE - default: qWarning("QCommonStyle::drawComplexControl: Control %d not handled", cc); } @@ -4106,10 +4040,8 @@ QRect QCommonStyle::subControlRect(ComplexControl cc, const QStyleOptionComplex } int frameWidth = 0; - if (!(widget && widget->inherits("Q3GroupBox")) - && ((groupBox->features & QStyleOptionFrameV2::Flat) == 0)) { + if ((groupBox->features & QStyleOptionFrameV2::Flat) == 0) frameWidth = proxy()->pixelMetric(PM_DefaultFrameWidth, groupBox, widget); - } ret = frameRect.adjusted(frameWidth, frameWidth + topHeight - topMargin, -frameWidth, -frameWidth); break; @@ -4160,50 +4092,6 @@ QRect QCommonStyle::subControlRect(ComplexControl cc, const QStyleOptionComplex break; } #endif // QT_NO_GROUPBOX -#ifndef QT_NO_WORKSPACE - case CC_MdiControls: - { - int numSubControls = 0; - if (opt->subControls & SC_MdiCloseButton) - ++numSubControls; - if (opt->subControls & SC_MdiMinButton) - ++numSubControls; - if (opt->subControls & SC_MdiNormalButton) - ++numSubControls; - if (numSubControls == 0) - break; - - int buttonWidth = opt->rect.width()/ numSubControls - 1; - int offset = 0; - switch (sc) { - case SC_MdiCloseButton: - // Only one sub control, no offset needed. - if (numSubControls == 1) - break; - offset += buttonWidth + 2; - //FALL THROUGH - case SC_MdiNormalButton: - // No offset needed if - // 1) There's only one sub control - // 2) We have a close button and a normal button (offset already added in SC_MdiClose) - if (numSubControls == 1 || (numSubControls == 2 && !(opt->subControls & SC_MdiMinButton))) - break; - if (opt->subControls & SC_MdiNormalButton) - offset += buttonWidth; - break; - default: - break; - } - - // Subtract one pixel if we only have one sub control. At this point - // buttonWidth is the actual width + 1 pixel margin, but we don't want the - // margin when there are no other controllers. - if (numSubControls == 1) - --buttonWidth; - ret = QRect(offset, 0, buttonWidth, opt->rect.height()); - break; - } -#endif // QT_NO_WORKSPACE default: qWarning("QCommonStyle::subControlRect: Case %d not handled", cc); } @@ -4233,10 +4121,6 @@ int QCommonStyle::pixelMetric(PixelMetric m, const QStyleOption *opt, const QWid case PM_DialogButtonsButtonHeight: ret = int(QStyleHelper::dpiScaled(30.)); break; - case PM_CheckListControllerSize: - case PM_CheckListButtonSize: - ret = int(QStyleHelper::dpiScaled(16.)); - break; case PM_TitleBarHeight: { if (const QStyleOptionTitleBar *tb = qstyleoption_cast<const QStyleOptionTitleBar *>(opt)) { if ((tb->titleBarFlags & Qt::WindowType_Mask) == Qt::Tool) { @@ -4711,7 +4595,6 @@ QSize QCommonStyle::sizeFromContents(ContentsType ct, const QStyleOption *opt, case CT_MenuBar: case CT_Menu: case CT_MenuBarItem: - case CT_Q3Header: case CT_Slider: case CT_ProgressBar: case CT_TabBarTab: @@ -4756,7 +4639,7 @@ int QCommonStyle::styleHint(StyleHint sh, const QStyleOption *opt, const QWidget break; #endif // QT_NO_GROUPBOX - case SH_Q3ListViewExpand_SelectMouseType: + case SH_ListViewExpand_SelectMouseType: case SH_TabBar_SelectMouseType: ret = QEvent::MouseButtonPress; break; |