summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorOlivier Goffart <ogoffart@trolltech.com>2009-06-11 10:07:50 (GMT)
committerOlivier Goffart <ogoffart@trolltech.com>2009-06-11 10:58:06 (GMT)
commitf20f242c7d45ad675c6d955628d318ffecdfe517 (patch)
tree02e37e90a696f9522abf2254e5a601eb3cbc69f3 /src
parent713e52d9531277b8c13856246701729de16d4502 (diff)
downloadQt-f20f242c7d45ad675c6d955628d318ffecdfe517.zip
Qt-f20f242c7d45ad675c6d955628d318ffecdfe517.tar.gz
Qt-f20f242c7d45ad675c6d955628d318ffecdfe517.tar.bz2
Make sure custom arrow images works if we only specify it.
Include change for spinbox, combobox, and menu. Task-number: 255849 Tested-by: Pierre Reviewed-by: jbache
Diffstat (limited to 'src')
-rw-r--r--src/gui/styles/qstylesheetstyle.cpp18
1 files changed, 14 insertions, 4 deletions
diff --git a/src/gui/styles/qstylesheetstyle.cpp b/src/gui/styles/qstylesheetstyle.cpp
index 9a8f97e..fe0e53c 100644
--- a/src/gui/styles/qstylesheetstyle.cpp
+++ b/src/gui/styles/qstylesheetstyle.cpp
@@ -2850,7 +2850,7 @@ void QStyleSheetStyle::drawComplexControl(ComplexControl cc, const QStyleOptionC
rule.drawBackgroundImage(p, cmbOpt.rect);
rule.configurePalette(&cmbOpt.palette, QPalette::ButtonText, QPalette::Button);
bool customDropDown = (opt->subControls & QStyle::SC_ComboBoxArrow)
- && hasStyleRule(w, PseudoElement_ComboBoxDropDown);
+ && (hasStyleRule(w, PseudoElement_ComboBoxDropDown) || hasStyleRule(w, PseudoElement_ComboBoxArrow));
if (customDropDown)
cmbOpt.subControls &= ~QStyle::SC_ComboBoxArrow;
if (rule.baseStyleCanDraw()) {
@@ -2896,11 +2896,11 @@ void QStyleSheetStyle::drawComplexControl(ComplexControl cc, const QStyleOptionC
if (rule.hasNativeBorder() && !upRuleMatch && !downRuleMatch) {
rule.drawBackgroundImage(p, spinOpt.rect);
customUp = (opt->subControls & QStyle::SC_SpinBoxUp)
- && hasStyleRule(w, PseudoElement_SpinBoxUpButton);
+ && (hasStyleRule(w, PseudoElement_SpinBoxUpButton) || hasStyleRule(w, PseudoElement_UpArrow));
if (customUp)
spinOpt.subControls &= ~QStyle::SC_SpinBoxUp;
customDown = (opt->subControls & QStyle::SC_SpinBoxDown)
- && hasStyleRule(w, PseudoElement_SpinBoxDownButton);
+ && (hasStyleRule(w, PseudoElement_SpinBoxDownButton) || hasStyleRule(w, PseudoElement_DownArrow));
if (customDown)
spinOpt.subControls &= ~QStyle::SC_SpinBoxDown;
if (rule.baseStyleCanDraw()) {
@@ -3573,7 +3573,7 @@ void QStyleSheetStyle::drawControl(ControlElement ce, const QStyleOption *opt, Q
mi.rect = positionRect(w, subRule, subRule2, PseudoElement_MenuRightArrow, opt->rect, mi.direction);
drawPrimitive(arrow, &mi, p, w);
}
- } else if (hasStyleRule(w, PseudoElement_MenuCheckMark)) {
+ } else if (hasStyleRule(w, PseudoElement_MenuCheckMark) || hasStyleRule(w, PseudoElement_MenuRightArrow)) {
QWindowsStyle::drawControl(ce, &mi, p, w);
} else {
if (rule.hasDrawable() && !subRule.hasDrawable() && !(opt->state & QStyle::State_Selected)) {
@@ -4339,6 +4339,16 @@ void QStyleSheetStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *op
pseudoElement = PseudoElement_ScrollAreaCorner;
break;
+ case PE_IndicatorSpinDown:
+ case PE_IndicatorSpinMinus:
+ pseudoElement = PseudoElement_SpinBoxDownArrow;
+ break;
+
+ case PE_IndicatorSpinUp:
+ case PE_IndicatorSpinPlus:
+ pseudoElement = PseudoElement_SpinBoxUpArrow;
+ break;
+
default:
break;
}