diff options
Diffstat (limited to 'src/gui/styles/qwindowsvistastyle.cpp')
-rw-r--r-- | src/gui/styles/qwindowsvistastyle.cpp | 76 |
1 files changed, 38 insertions, 38 deletions
diff --git a/src/gui/styles/qwindowsvistastyle.cpp b/src/gui/styles/qwindowsvistastyle.cpp index 9ea9a03..be76b24 100644 --- a/src/gui/styles/qwindowsvistastyle.cpp +++ b/src/gui/styles/qwindowsvistastyle.cpp @@ -403,7 +403,7 @@ void QWindowsVistaStyle::drawPrimitive(PrimitiveElement element, const QStyleOpt // pulsating default button into the intended target state. if (!anim) - drawPrimitive(element, &opt, &startPainter, 0); // Note that the widget pointer is intentionally 0 + proxy()->drawPrimitive(element, &opt, &startPainter, 0); // Note that the widget pointer is intentionally 0 else // this ensures that we do not recurse in the animation logic above anim->paint(&startPainter, &opt); @@ -417,7 +417,7 @@ void QWindowsVistaStyle::drawPrimitive(PrimitiveElement element, const QStyleOpt endImage.fill(0); QStyleOption opt2 = opt; opt2.state = option->state; - drawPrimitive(element, &opt2, &endPainter, 0); // Note that the widget pointer is intentionally 0 + proxy()->drawPrimitive(element, &opt2, &endPainter, 0); // Note that the widget pointer is intentionally 0 // this ensures that we do not recurse in the animation logic above t->setEndImage(endImage); @@ -645,7 +645,7 @@ void QWindowsVistaStyle::drawPrimitive(PrimitiveElement element, const QStyleOpt } } if (panel->lineWidth > 0) - drawPrimitive(PE_FrameLineEdit, panel, painter, widget); + proxy()->drawPrimitive(PE_FrameLineEdit, panel, painter, widget); return; } break; @@ -934,7 +934,7 @@ void QWindowsVistaStyle::drawControl(ControlElement element, const QStyleOption QPainter startPainter(&startImage); if (!anim) { - drawControl(element, &opt, &startPainter, 0 /* Intentional */); + proxy()->drawControl(element, &opt, &startPainter, 0 /* Intentional */); } else { anim->paint(&startPainter, &opt); d->stopAnimation(widget); @@ -945,7 +945,7 @@ void QWindowsVistaStyle::drawControl(ControlElement element, const QStyleOption endImage.fill(0); QPainter endPainter(&endImage); - drawControl(element, option, &endPainter, 0 /* Intentional */); + proxy()->drawControl(element, option, &endPainter, 0 /* Intentional */); t->setEndImage(endImage); int duration = 0; HTHEME theme = pOpenThemeData(0, L"Button"); @@ -1049,7 +1049,7 @@ void QWindowsVistaStyle::drawControl(ControlElement element, const QStyleOption newBtn.rect = QStyle::visualRect(option->direction, option->rect, QRect(ir.right() - mbiw - 2, (option->rect.height()/2) - (mbih/2), mbiw + 1, mbih + 1)); - drawPrimitive(PE_IndicatorArrowDown, &newBtn, painter, widget); + proxy()->drawPrimitive(PE_IndicatorArrowDown, &newBtn, painter, widget); } return; } @@ -1197,10 +1197,10 @@ void QWindowsVistaStyle::drawControl(ControlElement element, const QStyleOption break; QPalette::ColorRole textRole = disabled ? QPalette::Text : QPalette::ButtonText; - QPixmap pix = mbi->icon.pixmap(pixelMetric(PM_SmallIconSize, option, widget), QIcon::Normal); + QPixmap pix = mbi->icon.pixmap(proxy()->pixelMetric(PM_SmallIconSize, option, widget), QIcon::Normal); uint alignment = Qt::AlignCenter | Qt::TextShowMnemonic | Qt::TextDontClip | Qt::TextSingleLine; - if (!styleHint(SH_UnderlineShortcut, mbi, widget)) + if (!proxy()->styleHint(SH_UnderlineShortcut, mbi, widget)) alignment |= Qt::TextHideMnemonic; //The rect adjustment is a workaround for the menu not really filling its background. @@ -1292,9 +1292,9 @@ void QWindowsVistaStyle::drawControl(ControlElement element, const QStyleOption mode = QIcon::Active; QPixmap pixmap; if (checked) - pixmap = menuitem->icon.pixmap(pixelMetric(PM_SmallIconSize, option, widget), mode, QIcon::On); + pixmap = menuitem->icon.pixmap(proxy()->pixelMetric(PM_SmallIconSize, option, widget), mode, QIcon::On); else - pixmap = menuitem->icon.pixmap(pixelMetric(PM_SmallIconSize, option, widget), mode); + pixmap = menuitem->icon.pixmap(proxy()->pixelMetric(PM_SmallIconSize, option, widget), mode); int pixw = pixmap.width(); int pixh = pixmap.height(); QRect pmr(0, 0, pixw, pixh); @@ -1320,7 +1320,7 @@ void QWindowsVistaStyle::drawControl(ControlElement element, const QStyleOption painter->save(); int t = s.indexOf(QLatin1Char('\t')); int text_flags = Qt::AlignVCenter | Qt::TextShowMnemonic | Qt::TextDontClip | Qt::TextSingleLine; - if (!styleHint(SH_UnderlineShortcut, menuitem, widget)) + if (!proxy()->styleHint(SH_UnderlineShortcut, menuitem, widget)) text_flags |= Qt::TextHideMnemonic; text_flags |= Qt::AlignLeft; if (t >= 0) { @@ -1346,7 +1346,7 @@ void QWindowsVistaStyle::drawControl(ControlElement element, const QStyleOption QStyleOptionMenuItem newMI = *menuitem; newMI.rect = vSubMenuRect; newMI.state = dis ? State_None : State_Enabled; - drawPrimitive(arrow, &newMI, painter, widget); + proxy()->drawPrimitive(arrow, &newMI, painter, widget); } } break; @@ -1416,8 +1416,8 @@ void QWindowsVistaStyle::drawControl(ControlElement element, const QStyleOption painter->drawRect(rect.adjusted(0, 1, -1, -3)); int buttonMargin = 4; - int mw = pixelMetric(QStyle::PM_DockWidgetTitleMargin, dwOpt, widget); - int fw = pixelMetric(PM_DockWidgetFrameWidth, dwOpt, widget); + int mw = proxy()->pixelMetric(QStyle::PM_DockWidgetTitleMargin, dwOpt, widget); + int fw = proxy()->pixelMetric(PM_DockWidgetFrameWidth, dwOpt, widget); const QDockWidget *dw = qobject_cast<const QDockWidget *>(widget); bool isFloating = dw != 0 && dw->isFloating(); @@ -1556,7 +1556,7 @@ void QWindowsVistaStyle::drawComplexControl(ComplexControl control, const QStyle if (qstyleoption_cast<const QStyleOptionSlider *>(option)) { QRect oldSliderPos = w->property("_q_stylesliderpos").toRect(); - QRect currentPos = subControlRect(CC_ScrollBar, option, SC_ScrollBarSlider, widget); + QRect currentPos = proxy()->subControlRect(CC_ScrollBar, option, SC_ScrollBarSlider, widget); w->setProperty("_q_stylesliderpos", currentPos); if (oldSliderPos != currentPos) { doTransition = false; @@ -1587,7 +1587,7 @@ void QWindowsVistaStyle::drawComplexControl(ComplexControl control, const QStyle QStyleOptionComboBox startCombo = *combo; startCombo.state = (QStyle::State)oldState; startCombo.activeSubControls = (QStyle::SubControl)oldActiveControls; - drawComplexControl(control, &startCombo, &startPainter, 0 /* Intentional */); + proxy()->drawComplexControl(control, &startCombo, &startPainter, 0 /* Intentional */); t->setStartImage(startImage); } else if (const QStyleOptionSlider *slider = qstyleoption_cast<const QStyleOptionSlider*>(option)) { //This is a workaround for the direct3d engine as it currently has some issues with grabWindow @@ -1596,7 +1596,7 @@ void QWindowsVistaStyle::drawComplexControl(ComplexControl control, const QStyle QStyleOptionSlider startSlider = *slider; startSlider.state = (QStyle::State)oldState; startSlider.activeSubControls = (QStyle::SubControl)oldActiveControls; - drawComplexControl(control, &startSlider, &startPainter, 0 /* Intentional */); + proxy()->drawComplexControl(control, &startSlider, &startPainter, 0 /* Intentional */); t->setStartImage(startImage); } else { QPoint offset(0, 0); @@ -1614,7 +1614,7 @@ void QWindowsVistaStyle::drawComplexControl(ComplexControl control, const QStyle d->startAnimation(t); endImage.fill(0); QPainter endPainter(&endImage); - drawComplexControl(control, option, &endPainter, 0 /* Intentional */); + proxy()->drawComplexControl(control, option, &endPainter, 0 /* Intentional */); t->setEndImage(endImage); t->setStartTime(QTime::currentTime()); @@ -1653,9 +1653,9 @@ void QWindowsVistaStyle::drawComplexControl(ComplexControl control, const QStyle d->drawBackground(theme); } if (sub & SC_ComboBoxArrow) { - QRect subRect = subControlRect(CC_ComboBox, option, SC_ComboBoxArrow, widget); + QRect subRect = proxy()->subControlRect(CC_ComboBox, option, SC_ComboBoxArrow, widget); XPThemeData theme(widget, painter, QLatin1String("COMBOBOX")); - theme.rect = subControlRect(CC_ComboBox, option, SC_ComboBoxArrow, widget); + theme.rect = proxy()->subControlRect(CC_ComboBox, option, SC_ComboBoxArrow, widget); partId = option->direction == Qt::RightToLeft ? CP_DROPDOWNBUTTONLEFT : CP_DROPDOWNBUTTONRIGHT; if (!(cmb->state & State_Enabled)) @@ -1679,7 +1679,7 @@ void QWindowsVistaStyle::drawComplexControl(ComplexControl control, const QStyle btn.rect = option->rect.adjusted(-1, -1, 1, 1); if (sub & SC_ComboBoxArrow) btn.features = QStyleOptionButton::HasMenu; - drawControl(QStyle::CE_PushButton, &btn, painter, widget); + proxy()->drawControl(QStyle::CE_PushButton, &btn, painter, widget); } } } @@ -1696,7 +1696,7 @@ void QWindowsVistaStyle::drawComplexControl(ComplexControl control, const QStyle bool isHorz = flags & State_Horizontal; bool isRTL = option->direction == Qt::RightToLeft; if (sub & SC_ScrollBarAddLine) { - theme.rect = subControlRect(CC_ScrollBar, option, SC_ScrollBarAddLine, widget); + theme.rect = proxy()->subControlRect(CC_ScrollBar, option, SC_ScrollBarAddLine, widget); partId = SBP_ARROWBTN; if (!(flags & State_Enabled)) stateId = (isHorz ? (isRTL ? ABS_LEFTDISABLED : ABS_RIGHTDISABLED) : ABS_DOWNDISABLED); @@ -1713,7 +1713,7 @@ void QWindowsVistaStyle::drawComplexControl(ComplexControl control, const QStyle d->drawBackground(theme); } if (sub & SC_ScrollBarSubLine) { - theme.rect = subControlRect(CC_ScrollBar, option, SC_ScrollBarSubLine, widget); + theme.rect = proxy()->subControlRect(CC_ScrollBar, option, SC_ScrollBarSubLine, widget); partId = SBP_ARROWBTN; if (!(flags & State_Enabled)) stateId = (isHorz ? (isRTL ? ABS_RIGHTDISABLED : ABS_LEFTDISABLED) : ABS_UPDISABLED); @@ -1730,9 +1730,9 @@ void QWindowsVistaStyle::drawComplexControl(ComplexControl control, const QStyle d->drawBackground(theme); } if (maxedOut) { - theme.rect = subControlRect(CC_ScrollBar, option, SC_ScrollBarSlider, widget); - theme.rect = theme.rect.united(subControlRect(CC_ScrollBar, option, SC_ScrollBarSubPage, widget)); - theme.rect = theme.rect.united(subControlRect(CC_ScrollBar, option, SC_ScrollBarAddPage, widget)); + theme.rect = proxy()->subControlRect(CC_ScrollBar, option, SC_ScrollBarSlider, widget); + theme.rect = theme.rect.united(proxy()->subControlRect(CC_ScrollBar, option, SC_ScrollBarSubPage, widget)); + theme.rect = theme.rect.united(proxy()->subControlRect(CC_ScrollBar, option, SC_ScrollBarAddPage, widget)); partId = flags & State_Horizontal ? SBP_LOWERTRACKHORZ : SBP_LOWERTRACKVERT; stateId = SCRBS_DISABLED; theme.partId = partId; @@ -1740,7 +1740,7 @@ void QWindowsVistaStyle::drawComplexControl(ComplexControl control, const QStyle d->drawBackground(theme); } else { if (sub & SC_ScrollBarSubPage) { - theme.rect = subControlRect(CC_ScrollBar, option, SC_ScrollBarSubPage, widget); + theme.rect = proxy()->subControlRect(CC_ScrollBar, option, SC_ScrollBarSubPage, widget); partId = flags & State_Horizontal ? SBP_UPPERTRACKHORZ : SBP_UPPERTRACKVERT; if (!(flags & State_Enabled)) stateId = SCRBS_DISABLED; @@ -1755,7 +1755,7 @@ void QWindowsVistaStyle::drawComplexControl(ComplexControl control, const QStyle d->drawBackground(theme); } if (sub & SC_ScrollBarAddPage) { - theme.rect = subControlRect(CC_ScrollBar, option, SC_ScrollBarAddPage, widget); + theme.rect = proxy()->subControlRect(CC_ScrollBar, option, SC_ScrollBarAddPage, widget); partId = flags & State_Horizontal ? SBP_LOWERTRACKHORZ : SBP_LOWERTRACKVERT; if (!(flags & State_Enabled)) stateId = SCRBS_DISABLED; @@ -1770,7 +1770,7 @@ void QWindowsVistaStyle::drawComplexControl(ComplexControl control, const QStyle d->drawBackground(theme); } if (sub & SC_ScrollBarSlider) { - theme.rect = subControlRect(CC_ScrollBar, option, SC_ScrollBarSlider, widget); + theme.rect = proxy()->subControlRect(CC_ScrollBar, option, SC_ScrollBarSlider, widget); if (!(flags & State_Enabled)) stateId = SCRBS_DISABLED; else if (scrollbar->activeSubControls & SC_ScrollBarSlider && (scrollbar->state & State_Sunken)) @@ -1783,7 +1783,7 @@ void QWindowsVistaStyle::drawComplexControl(ComplexControl control, const QStyle stateId = SCRBS_NORMAL; // Draw handle - theme.rect = subControlRect(CC_ScrollBar, option, SC_ScrollBarSlider, widget); + theme.rect = proxy()->subControlRect(CC_ScrollBar, option, SC_ScrollBarSlider, widget); theme.partId = flags & State_Horizontal ? SBP_THUMBBTNHORZ : SBP_THUMBBTNVERT; theme.stateId = stateId; d->drawBackground(theme); @@ -1851,7 +1851,7 @@ void QWindowsVistaStyle::drawComplexControl(ComplexControl control, const QStyle d->drawBackground(ftheme); } if (sub & SC_SpinBoxUp) { - theme.rect = subControlRect(CC_SpinBox, option, SC_SpinBoxUp, widget).adjusted(0, 0, 0, 1); + theme.rect = proxy()->subControlRect(CC_SpinBox, option, SC_SpinBoxUp, widget).adjusted(0, 0, 0, 1); partId = SPNP_UP; if (!(sb->stepEnabled & QAbstractSpinBox::StepUpEnabled) || !(flags & State_Enabled)) stateId = UPS_DISABLED; @@ -1866,7 +1866,7 @@ void QWindowsVistaStyle::drawComplexControl(ComplexControl control, const QStyle d->drawBackground(theme); } if (sub & SC_SpinBoxDown) { - theme.rect = subControlRect(CC_SpinBox, option, SC_SpinBoxDown, widget); + theme.rect = proxy()->subControlRect(CC_SpinBox, option, SC_SpinBoxDown, widget); partId = SPNP_DOWN; if (!(sb->stepEnabled & QAbstractSpinBox::StepDownEnabled) || !(flags & State_Enabled)) stateId = DNS_DISABLED; @@ -1947,7 +1947,7 @@ QSize QWindowsVistaStyle::sizeFromContents(ContentsType type, const QStyleOption { //Spinbox adds frame twice sz = QWindowsStyle::sizeFromContents(type, option, size, widget); - int border = pixelMetric(PM_SpinBoxFrameWidth, option, widget); + int border = proxy()->pixelMetric(PM_SpinBoxFrameWidth, option, widget); sz -= QSize(2*border, 2*border); } return sz; @@ -1985,7 +1985,7 @@ QRect QWindowsVistaStyle::subElementRect(SubElement element, const QStyleOption else stateId = PBS_NORMAL; - int border = pixelMetric(PM_DefaultFrameWidth, btn, widget); + int border = proxy()->pixelMetric(PM_DefaultFrameWidth, btn, widget); rect = option->rect.adjusted(border, border, -border, -border); int result = pGetThemeMargins(theme, @@ -2012,7 +2012,7 @@ QRect QWindowsVistaStyle::subElementRect(SubElement element, const QStyleOption int w = option->rect.width(); int x = option->rect.x(); int y = option->rect.y(); - int margin = pixelMetric(QStyle::PM_HeaderMargin, option, widget); + int margin = proxy()->pixelMetric(QStyle::PM_HeaderMargin, option, widget); XPThemeData theme(widget, 0, QLatin1String("HEADER"), HP_HEADERSORTARROW, HSAS_SORTEDDOWN, option->rect); @@ -2038,7 +2038,7 @@ QRect QWindowsVistaStyle::subElementRect(SubElement element, const QStyleOption case SE_HeaderLabel: { - int margin = pixelMetric(QStyle::PM_HeaderMargin, option, widget); + int margin = proxy()->pixelMetric(QStyle::PM_HeaderMargin, option, widget); QRect r = option->rect; r.setRect(option->rect.x() + margin, option->rect.y() + margin, option->rect.width() - margin * 2, option->rect.height() - margin * 2); @@ -2214,7 +2214,7 @@ QRect QWindowsVistaStyle::subControlRect(ComplexControl control, const QStyleOpt const int width = tb->rect.width(); int buttonWidth = GetSystemMetrics(SM_CXSIZE) - 4; - const int frameWidth = pixelMetric(PM_MdiSubWindowFrameWidth, option, widget); + const int frameWidth = proxy()->pixelMetric(PM_MdiSubWindowFrameWidth, option, widget); const bool sysmenuHint = (tb->titleBarFlags & Qt::WindowSystemMenuHint) != 0; const bool minimizeHint = (tb->titleBarFlags & Qt::WindowMinimizeButtonHint) != 0; const bool maximizeHint = (tb->titleBarFlags & Qt::WindowMaximizeButtonHint) != 0; @@ -2251,7 +2251,7 @@ QRect QWindowsVistaStyle::subControlRect(ComplexControl control, const QStyleOpt { const int controlTop = 6; const int controlHeight = height - controlTop - 3; - int iconExtent = pixelMetric(PM_SmallIconSize); + int iconExtent = proxy()->pixelMetric(PM_SmallIconSize); QSize iconSize = tb->icon.actualSize(QSize(iconExtent, iconExtent)); if (tb->icon.isNull()) iconSize = QSize(controlHeight, controlHeight); |