diff options
author | Jens Bache-Wiig <jbache@trolltech.com> | 2009-06-12 14:53:40 (GMT) |
---|---|---|
committer | Jens Bache-Wiig <jbache@trolltech.com> | 2009-06-12 15:05:11 (GMT) |
commit | 4d0cc0b9600f8530bb0e8712b4bb109d1810c4a7 (patch) | |
tree | 766d2cbcad6082f794217000778b46ac8d2a7890 /src/gui/styles/qgtkstyle.cpp | |
parent | 56b93b836f70e121540e8d8da9447f5dc6e1fdd6 (diff) | |
download | Qt-4d0cc0b9600f8530bb0e8712b4bb109d1810c4a7.zip Qt-4d0cc0b9600f8530bb0e8712b4bb109d1810c4a7.tar.gz Qt-4d0cc0b9600f8530bb0e8712b4bb109d1810c4a7.tar.bz2 |
Integrating QProxyStyle
This class adds convenient support for proxy styles in Qt.
Note that to support proper proxying, styles now
call their functions through proxy() so that the proxy regains control
over subcomponents. Note that there is a small price to be payed
by the extra function call which can at the cost of readability
be redirected to the private class member in the future.
Task-number: 229556
Reviewed-by: trond
Diffstat (limited to 'src/gui/styles/qgtkstyle.cpp')
-rw-r--r-- | src/gui/styles/qgtkstyle.cpp | 118 |
1 files changed, 59 insertions, 59 deletions
diff --git a/src/gui/styles/qgtkstyle.cpp b/src/gui/styles/qgtkstyle.cpp index ab81d97..28dff3b 100644 --- a/src/gui/styles/qgtkstyle.cpp +++ b/src/gui/styles/qgtkstyle.cpp @@ -674,14 +674,14 @@ void QGtkStyle::drawPrimitive(PrimitiveElement element, if (widget && widget->inherits("QComboBoxPrivateContainer")){ QStyleOption copy = *option; copy.state |= State_Raised; - drawPrimitive(PE_PanelMenu, ©, painter, widget); + proxy()->drawPrimitive(PE_PanelMenu, ©, painter, widget); break; } // Drawing the entire itemview frame is very expensive, especially on the native X11 engine // Instead we cheat a bit and draw a border image without the center part, hence only scaling // thin rectangular images const int pmSize = 64; - const int border = pixelMetric(PM_DefaultFrameWidth, option, widget); + const int border = proxy()->pixelMetric(PM_DefaultFrameWidth, option, widget); const QString pmKey = QString(QLS("windowframe %0")).arg(option->state); QPixmap pixmap; @@ -892,8 +892,8 @@ void QGtkStyle::drawPrimitive(PrimitiveElement element, int border = (size > 9) ? (size/4) : 0; //Allow small arrows to have exact dimensions int bsx = 0, bsy = 0; if (option->state & State_Sunken) { - bsx = pixelMetric(PM_ButtonShiftHorizontal); - bsy = pixelMetric(PM_ButtonShiftVertical); + bsx = proxy()->pixelMetric(PM_ButtonShiftHorizontal); + bsy = proxy()->pixelMetric(PM_ButtonShiftVertical); } QRect arrowRect = option->rect.adjusted(border + bsx, border + bsy, -border + bsx, -border + bsy); GtkShadowType shadow = option->state & State_Sunken ? GTK_SHADOW_IN : GTK_SHADOW_OUT; @@ -973,7 +973,7 @@ void QGtkStyle::drawPrimitive(PrimitiveElement element, if (const QStyleOptionFrame *panel = qstyleoption_cast<const QStyleOptionFrame *>(option)) { GtkWidget *gtkEntry = QGtk::gtkWidget(QLS("GtkEntry")); if (panel->lineWidth > 0) - drawPrimitive(PE_FrameLineEdit, option, painter, widget); + proxy()->drawPrimitive(PE_FrameLineEdit, option, painter, widget); uint resolve_mask = option->palette.resolve(); QRect textRect = option->rect.adjusted(gtkEntry->style->xthickness, gtkEntry->style->ythickness, -gtkEntry->style->xthickness, -gtkEntry->style->ythickness); @@ -1244,8 +1244,8 @@ void QGtkStyle::drawComplexControl(ComplexControl control, const QStyleOptionCom painter->save(); if (const QStyleOptionGroupBox *groupBox = qstyleoption_cast<const QStyleOptionGroupBox *>(option)) { - QRect textRect = subControlRect(CC_GroupBox, groupBox, SC_GroupBoxLabel, widget); - QRect checkBoxRect = subControlRect(CC_GroupBox, groupBox, SC_GroupBoxCheckBox, widget); + QRect textRect = proxy()->subControlRect(CC_GroupBox, groupBox, SC_GroupBoxLabel, widget); + QRect checkBoxRect = proxy()->subControlRect(CC_GroupBox, groupBox, SC_GroupBoxCheckBox, widget); // Draw title if ((groupBox->subControls & QStyle::SC_GroupBoxLabel) && !groupBox->text.isEmpty()) { @@ -1260,7 +1260,7 @@ void QGtkStyle::drawComplexControl(ComplexControl control, const QStyleOptionCom if (!groupBox->text.isEmpty()) { int alignment = int(groupBox->textAlignment); - if (!styleHint(QStyle::SH_UnderlineShortcut, option, widget)) + if (!proxy()->styleHint(QStyle::SH_UnderlineShortcut, option, widget)) alignment |= Qt::TextHideMnemonic; QColor textColor = groupBox->textColor; // Note: custom textColor is currently ignored int labelState = GTK_STATE_INSENSITIVE; @@ -1285,7 +1285,7 @@ void QGtkStyle::drawComplexControl(ComplexControl control, const QStyleOptionCom QStyleOptionButton box; box.QStyleOption::operator=(*groupBox); box.rect = checkBoxRect; - drawPrimitive(PE_IndicatorCheckBox, &box, painter, widget); + proxy()->drawPrimitive(PE_IndicatorCheckBox, &box, painter, widget); } } @@ -1308,7 +1308,7 @@ void QGtkStyle::drawComplexControl(ComplexControl control, const QStyleOptionCom bool focus = isEnabled && (comboBox->state & State_HasFocus); QColor buttonShadow = option->palette.dark().color(); GtkStateType state = gtkPainter.gtkState(option); - int appears_as_list = !styleHint(QStyle::SH_ComboBox_Popup, comboBox, widget); + int appears_as_list = !proxy()->styleHint(QStyle::SH_ComboBox_Popup, comboBox, widget); QPixmap cache; QString pixmapName; QStyleOptionComboBox comboBoxCopy = *comboBox; @@ -1316,9 +1316,9 @@ void QGtkStyle::drawComplexControl(ComplexControl control, const QStyleOptionCom bool reverse = (option->direction == Qt::RightToLeft); QRect rect = option->rect; - QRect arrowButtonRect = subControlRect(CC_ComboBox, &comboBoxCopy, + QRect arrowButtonRect = proxy()->subControlRect(CC_ComboBox, &comboBoxCopy, SC_ComboBoxArrow, widget); - QRect editRect = subControlRect(CC_ComboBox, &comboBoxCopy, + QRect editRect = proxy()->subControlRect(CC_ComboBox, &comboBoxCopy, SC_ComboBoxEditField, widget); GtkShadowType shadow = (option->state & State_Sunken || option->state & State_On ) ? @@ -1497,8 +1497,8 @@ void QGtkStyle::drawComplexControl(ComplexControl control, const QStyleOptionCom if (const QStyleOptionToolButton *toolbutton = qstyleoption_cast<const QStyleOptionToolButton *>(option)) { QRect button, menuarea; - button = subControlRect(control, toolbutton, SC_ToolButton, widget); - menuarea = subControlRect(control, toolbutton, SC_ToolButtonMenu, widget); + button = proxy()->subControlRect(control, toolbutton, SC_ToolButton, widget); + menuarea = proxy()->subControlRect(control, toolbutton, SC_ToolButtonMenu, widget); State bflags = toolbutton->state & ~(State_Sunken | State_MouseOver); if (bflags & State_AutoRaise) @@ -1527,7 +1527,7 @@ void QGtkStyle::drawComplexControl(ComplexControl control, const QStyleOptionCom if (bflags & (State_Sunken | State_On | State_Raised | State_MouseOver)) { tool.rect = button; tool.state = bflags; - drawPrimitive(PE_PanelButtonTool, &tool, painter, widget); + proxy()->drawPrimitive(PE_PanelButtonTool, &tool, painter, widget); } } @@ -1538,9 +1538,9 @@ void QGtkStyle::drawComplexControl(ComplexControl control, const QStyleOptionCom if (toolbutton->state & State_HasFocus) { QStyleOptionFocusRect fr; fr.QStyleOption::operator=(*toolbutton); - fr.rect = subControlRect(CC_ToolButton, toolbutton, SC_ToolButton, widget); + fr.rect = proxy()->subControlRect(CC_ToolButton, toolbutton, SC_ToolButton, widget); fr.rect.adjust(1, 1, -1, -1); - drawPrimitive(PE_FrameFocusRect, &fr, painter, widget); + proxy()->drawPrimitive(PE_FrameFocusRect, &fr, painter, widget); } QStyleOptionToolButton label = *toolbutton; @@ -1556,21 +1556,21 @@ void QGtkStyle::drawComplexControl(ComplexControl control, const QStyleOptionCom } label.rect = button.adjusted(style->xthickness, style->ythickness, -style->xthickness - popupArrowSize, -style->ythickness); - drawControl(CE_ToolButtonLabel, &label, painter, widget); + proxy()->drawControl(CE_ToolButtonLabel, &label, painter, widget); if (toolbutton->subControls & SC_ToolButtonMenu) { tool.rect = menuarea; tool.state = mflags; if ((mflags & State_Enabled && (mflags & (State_Sunken | State_Raised | State_MouseOver))) || !(mflags & State_AutoRaise)) - drawPrimitive(PE_IndicatorButtonDropDown, &tool, painter, widget); + proxy()->drawPrimitive(PE_IndicatorButtonDropDown, &tool, painter, widget); - drawPrimitive(PE_IndicatorArrowDown, &tool, painter, widget); + proxy()->drawPrimitive(PE_IndicatorArrowDown, &tool, painter, widget); } else if (drawMenuArrow) { QRect ir = toolbutton->rect; QStyleOptionToolButton newBtn = *toolbutton; newBtn.rect = QRect(ir.right() - popupArrowSize - style->xthickness - 3, ir.height()/2 - 1, popupArrowSize, popupArrowSize); - drawPrimitive(PE_IndicatorArrowDown, &newBtn, painter, widget); + proxy()->drawPrimitive(PE_IndicatorArrowDown, &newBtn, painter, widget); } } break; @@ -1587,10 +1587,10 @@ void QGtkStyle::drawComplexControl(ComplexControl control, const QStyleOptionCom painter->fillRect(option->rect, option->palette.background()); QRect rect = scrollBar->rect; - QRect scrollBarSubLine = subControlRect(control, scrollBar, SC_ScrollBarSubLine, widget); - QRect scrollBarAddLine = subControlRect(control, scrollBar, SC_ScrollBarAddLine, widget); - QRect scrollBarSlider = subControlRect(control, scrollBar, SC_ScrollBarSlider, widget); - QRect grooveRect = subControlRect(control, scrollBar, SC_ScrollBarGroove, widget); + QRect scrollBarSubLine = proxy()->subControlRect(control, scrollBar, SC_ScrollBarSubLine, widget); + QRect scrollBarAddLine = proxy()->subControlRect(control, scrollBar, SC_ScrollBarAddLine, widget); + QRect scrollBarSlider = proxy()->subControlRect(control, scrollBar, SC_ScrollBarSlider, widget); + QRect grooveRect = proxy()->subControlRect(control, scrollBar, SC_ScrollBarGroove, widget); bool horizontal = scrollBar->orientation == Qt::Horizontal; GtkWidget * scrollbarWidget = horizontal ? gtkHScrollBar : gtkVScrollBar; style = scrollbarWidget->style; @@ -1734,7 +1734,7 @@ void QGtkStyle::drawComplexControl(ComplexControl control, const QStyleOptionCom bool reverse = (spinBox->direction == Qt::RightToLeft); //### Move this to subControlRect - QRect upRect = subControlRect(CC_SpinBox, option, SC_SpinBoxUp, widget); + QRect upRect = proxy()->subControlRect(CC_SpinBox, option, SC_SpinBoxUp, widget); upRect.setTop(option->rect.top()); if (reverse) @@ -1742,8 +1742,8 @@ void QGtkStyle::drawComplexControl(ComplexControl control, const QStyleOptionCom else upRect.setRight(option->rect.right()); - QRect editRect = subControlRect(CC_SpinBox, option, SC_SpinBoxEditField, widget); - QRect downRect = subControlRect(CC_SpinBox, option, SC_SpinBoxDown, widget); + QRect editRect = proxy()->subControlRect(CC_SpinBox, option, SC_SpinBoxEditField, widget); + QRect downRect = proxy()->subControlRect(CC_SpinBox, option, SC_SpinBoxDown, widget); downRect.setBottom(option->rect.bottom()); if (reverse) @@ -1875,9 +1875,9 @@ void QGtkStyle::drawComplexControl(ComplexControl control, const QStyleOptionCom GtkWidget *hScaleWidget = QGtk::gtkWidget(QLS("GtkHScale")); GtkWidget *vScaleWidget = QGtk::gtkWidget(QLS("GtkVScale")); - QRect groove = subControlRect(CC_Slider, option, SC_SliderGroove, widget); - QRect handle = subControlRect(CC_Slider, option, SC_SliderHandle, widget); - QRect ticks = subControlRect(CC_Slider, option, SC_SliderTickmarks, widget); + QRect groove = proxy()->subControlRect(CC_Slider, option, SC_SliderGroove, widget); + QRect handle = proxy()->subControlRect(CC_Slider, option, SC_SliderHandle, widget); + QRect ticks = proxy()->subControlRect(CC_Slider, option, SC_SliderTickmarks, widget); bool horizontal = slider->orientation == Qt::Horizontal; bool ticksAbove = slider->tickPosition & QSlider::TicksAbove; @@ -1932,8 +1932,8 @@ void QGtkStyle::drawComplexControl(ComplexControl control, const QStyleOptionCom if (option->subControls & SC_SliderTickmarks) { painter->setPen(darkOutline); - int tickSize = pixelMetric(PM_SliderTickmarkOffset, option, widget); - int available = pixelMetric(PM_SliderSpaceAvailable, slider, widget); + int tickSize = proxy()->pixelMetric(PM_SliderTickmarkOffset, option, widget); + int available = proxy()->pixelMetric(PM_SliderSpaceAvailable, slider, widget); int interval = slider->tickInterval; if (interval <= 0) { @@ -1950,7 +1950,7 @@ void QGtkStyle::drawComplexControl(ComplexControl control, const QStyleOptionCom interval = 1; int v = slider->minimum; - int len = pixelMetric(PM_SliderLength, slider, widget); + int len = proxy()->pixelMetric(PM_SliderLength, slider, widget); while (v <= slider->maximum + 1) { if (v == slider->maximum + 1 && interval == 1) break; @@ -2011,7 +2011,7 @@ void QGtkStyle::drawComplexControl(ComplexControl control, const QStyleOptionCom fropt.rect.setLeft(handle.left() - 3); fropt.rect.setRight(handle.right() + 3); } - drawPrimitive(PE_FrameFocusRect, &fropt, painter, widget); + proxy()->drawPrimitive(PE_FrameFocusRect, &fropt, painter, widget); } gtkPainter.paintSlider( scaleWidget, horizontal ? "hscale" : "vscale", handle, state, shadow, style, @@ -2101,9 +2101,9 @@ void QGtkStyle::drawControl(ControlElement element, if (option->state & State_Sunken) buttonShift = QPoint(pixelMetric(PM_ButtonShiftHorizontal, option, widget), - pixelMetric(PM_ButtonShiftVertical, option, widget)); + proxy()->pixelMetric(PM_ButtonShiftVertical, option, widget)); - if (styleHint(SH_UnderlineShortcut, button, widget)) + if (proxy()->styleHint(SH_UnderlineShortcut, button, widget)) tf |= Qt::TextShowMnemonic; else tf |= Qt::TextHideMnemonic; @@ -2164,7 +2164,7 @@ void QGtkStyle::drawControl(ControlElement element, GdkColor gdkText = gtkButton->style->fg[labelState]; QColor textColor = QColor(gdkText.red>>8, gdkText.green>>8, gdkText.blue>>8); pal.setBrush(QPalette::ButtonText, textColor); - drawItemText(painter, ir, tf, pal, (button->state & State_Enabled), + proxy()->drawItemText(painter, ir, tf, pal, (button->state & State_Enabled), button->text, QPalette::ButtonText); } break; @@ -2185,7 +2185,7 @@ void QGtkStyle::drawControl(ControlElement element, QStyleOptionButton subopt = *btn; subopt.rect = subElementRect(isRadio ? SE_RadioButtonIndicator : SE_CheckBoxIndicator, btn, widget); - drawPrimitive(isRadio ? PE_IndicatorRadioButton : PE_IndicatorCheckBox, + proxy()->drawPrimitive(isRadio ? PE_IndicatorRadioButton : PE_IndicatorCheckBox, &subopt, painter, widget); subopt.rect = subElementRect(isRadio ? SE_RadioButtonContents : SE_CheckBoxContents, btn, widget); @@ -2199,14 +2199,14 @@ void QGtkStyle::drawControl(ControlElement element, QColor textColor = QColor(gdkText.red>>8, gdkText.green>>8, gdkText.blue>>8); pal.setBrush(QPalette::WindowText, textColor); subopt.palette = pal; - drawControl(isRadio ? CE_RadioButtonLabel : CE_CheckBoxLabel, &subopt, painter, widget); + proxy()->drawControl(isRadio ? CE_RadioButtonLabel : CE_CheckBoxLabel, &subopt, painter, widget); if (btn->state & State_HasFocus) { QStyleOptionFocusRect fropt; fropt.QStyleOption::operator=(*btn); fropt.rect = subElementRect(isRadio ? SE_RadioButtonFocusRect : SE_CheckBoxFocusRect, btn, widget); - drawPrimitive(PE_FrameFocusRect, &fropt, painter, widget); + proxy()->drawPrimitive(PE_FrameFocusRect, &fropt, painter, widget); } } break; @@ -2215,8 +2215,8 @@ void QGtkStyle::drawControl(ControlElement element, case CE_ComboBoxLabel: if (const QStyleOptionComboBox *cb = qstyleoption_cast<const QStyleOptionComboBox *>(option)) { - QRect editRect = subControlRect(CC_ComboBox, cb, SC_ComboBoxEditField, widget); - bool appearsAsList = !styleHint(QStyle::SH_ComboBox_Popup, cb, widget); + QRect editRect = proxy()->subControlRect(CC_ComboBox, cb, SC_ComboBoxEditField, widget); + bool appearsAsList = !proxy()->styleHint(QStyle::SH_ComboBox_Popup, cb, widget); painter->save(); painter->setClipRect(editRect); @@ -2234,7 +2234,7 @@ void QGtkStyle::drawControl(ControlElement element, if (cb->editable) painter->fillRect(iconRect, option->palette.brush(QPalette::Base)); - drawItemPixmap(painter, iconRect, Qt::AlignCenter, pixmap); + proxy()->drawItemPixmap(painter, iconRect, Qt::AlignCenter, pixmap); if (cb->direction == Qt::RightToLeft) editRect.translate(-4 - cb->iconSize.width(), 0); @@ -2256,7 +2256,7 @@ void QGtkStyle::drawControl(ControlElement element, pal.setBrush(QPalette::ButtonText, textColor); - drawItemText(painter, editRect.adjusted(1, 0, -1, 0), + proxy()->drawItemText(painter, editRect.adjusted(1, 0, -1, 0), visualAlignment(cb->direction, Qt::AlignLeft | Qt::AlignVCenter), pal, cb->state & State_Enabled, cb->currentText, QPalette::ButtonText); } @@ -2302,7 +2302,7 @@ void QGtkStyle::drawControl(ControlElement element, QString titleText = painter->fontMetrics().elidedText(dwOpt->title, Qt::ElideRight, titleRect.width()); - drawItemText(painter, + proxy()->drawItemText(painter, titleRect, Qt::AlignLeft | Qt::AlignVCenter | Qt::TextShowMnemonic, dwOpt->palette, dwOpt->state & State_Enabled, titleText, @@ -2423,10 +2423,10 @@ void QGtkStyle::drawControl(ControlElement element, QPalette::ColorRole textRole = dis ? QPalette::Text : QPalette::HighlightedText; uint alignment = Qt::AlignCenter | Qt::TextShowMnemonic | Qt::TextDontClip | Qt::TextSingleLine; - if (!QCleanlooksStyle::styleHint(SH_UnderlineShortcut, mbi, widget)) + if (!proxy()->styleHint(SH_UnderlineShortcut, mbi, widget)) alignment |= Qt::TextHideMnemonic; - drawItemText(painter, item.rect, alignment, item.palette, mbi->state & State_Enabled, mbi->text, textRole); + proxy()->drawItemText(painter, item.rect, alignment, item.palette, mbi->state & State_Enabled, mbi->text, textRole); } } painter->restore(); @@ -2598,7 +2598,7 @@ void QGtkStyle::drawControl(ControlElement element, mode = QIcon::Active; QPixmap pixmap; - int smallIconSize = pixelMetric(PM_SmallIconSize, option, widget); + int smallIconSize = proxy()->pixelMetric(PM_SmallIconSize, option, widget); QSize iconSize(smallIconSize, smallIconSize); #ifndef QT_NO_COMBOBOX @@ -2626,7 +2626,7 @@ void QGtkStyle::drawControl(ControlElement element, } opt.state |= State_Sunken; opt.rect = vCheckRect; - drawPrimitive(PE_PanelButtonCommand, &opt, painter, widget); + proxy()->drawPrimitive(PE_PanelButtonCommand, &opt, painter, widget); } painter->drawPixmap(pmr.topLeft(), pixmap); } @@ -2666,7 +2666,7 @@ void QGtkStyle::drawControl(ControlElement element, 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; // Draw shortcut right aligned @@ -2699,7 +2699,7 @@ void QGtkStyle::drawControl(ControlElement element, // Arrow if (menuItem->menuItemType == QStyleOptionMenuItem::SubMenu) {// draw sub menu arrow QPoint buttonShift(pixelMetric(PM_ButtonShiftHorizontal, option, widget), - pixelMetric(PM_ButtonShiftVertical, option, widget)); + proxy()->pixelMetric(PM_ButtonShiftVertical, option, widget)); QFontMetrics fm(menuitem->font); int arrow_size = fm.ascent() + fm.descent() - 2 * gtkMenuItem->style->ythickness; @@ -2727,7 +2727,7 @@ void QGtkStyle::drawControl(ControlElement element, case CE_PushButton: if (const QStyleOptionButton *btn = qstyleoption_cast<const QStyleOptionButton *>(option)) { GtkWidget *gtkButton = QGtk::gtkWidget(QLS("GtkButton")); - drawControl(CE_PushButtonBevel, btn, painter, widget); + proxy()->drawControl(CE_PushButtonBevel, btn, painter, widget); QStyleOptionButton subopt = *btn; subopt.rect = subElementRect(SE_PushButtonContents, btn, widget); gint interiorFocus = true; @@ -2737,14 +2737,14 @@ void QGtkStyle::drawControl(ControlElement element, if (btn->features & QStyleOptionButton::Flat && btn->state & State_HasFocus) // The normal button focus rect does not work well for flat buttons in Clearlooks - drawPrimitive(PE_FrameFocusRect, option, painter, widget); + proxy()->drawPrimitive(PE_FrameFocusRect, option, painter, widget); else if (btn->state & State_HasFocus) gtkPainter.paintFocus(gtkButton, "button", option->rect.adjusted(xt, yt, -xt, -yt), btn->state & State_Sunken ? GTK_STATE_ACTIVE : GTK_STATE_NORMAL, gtkButton->style); - drawControl(CE_PushButtonLabel, &subopt, painter, widget); + proxy()->drawControl(CE_PushButtonLabel, &subopt, painter, widget); } break; @@ -2962,8 +2962,8 @@ QRect QGtkStyle::subControlRect(ComplexControl control, const QStyleOptionComple font.setBold(true); QFontMetrics fontMetrics(font); QSize textRect = fontMetrics.boundingRect(groupBoxWidget->title()).size() + QSize(4, 4); - int indicatorWidth = pixelMetric(PM_IndicatorWidth, option, widget); - int indicatorHeight = pixelMetric(PM_IndicatorHeight, option, widget); + int indicatorWidth = proxy()->pixelMetric(PM_IndicatorWidth, option, widget); + int indicatorHeight = proxy()->pixelMetric(PM_IndicatorHeight, option, widget); if (subControl == SC_GroupBoxCheckBox) { rect.setWidth(indicatorWidth); @@ -3044,7 +3044,7 @@ QRect QGtkStyle::subControlRect(ComplexControl control, const QStyleOptionComple QGtk::gtk_widget_set_direction(gtkCombo, (option->direction == Qt::RightToLeft) ? GTK_TEXT_DIR_RTL : GTK_TEXT_DIR_LTR); GtkAllocation geometry = {0, 0, qMax(0, option->rect.width()), qMax(0, option->rect.height())}; QGtk::gtk_widget_size_allocate(gtkCombo, &geometry); - int appears_as_list = !styleHint(QStyle::SH_ComboBox_Popup, option, widget); + int appears_as_list = !proxy()->styleHint(QStyle::SH_ComboBox_Popup, option, widget); QString arrowPath = comboBoxPath + QLS(".GtkToggleButton"); if (!box->editable && !appears_as_list) @@ -3208,7 +3208,7 @@ QSize QGtkStyle::sizeFromContents(ContentsType type, const QStyleOption *option, case CT_ComboBox: if (const QStyleOptionComboBox *combo = qstyleoption_cast<const QStyleOptionComboBox *>(option)) { GtkWidget *gtkCombo = QGtk::gtkWidget(QLS("GtkComboBox")); - QRect arrowButtonRect = subControlRect(CC_ComboBox, combo, SC_ComboBoxArrow, widget); + QRect arrowButtonRect = proxy()->subControlRect(CC_ComboBox, combo, SC_ComboBoxArrow, widget); newSize = size + QSize(12 + arrowButtonRect.width() + 2*gtkCombo->style->xthickness, 4 + 2*gtkCombo->style->ythickness); if (!(widget && qobject_cast<QToolBar *>(widget->parentWidget()))) |