summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@nokia.com>2009-08-06 09:15:20 (GMT)
committerTor Arne Vestbø <tor.arne.vestbo@nokia.com>2009-08-06 11:01:19 (GMT)
commit419079fb47c90d487b4e1f42029b70d5ec8f0d2d (patch)
tree700a82d76c1b08ff4604eafdcb4a922ef4326699 /src/gui
parent97ee0644d4a0c3e03e835c07d99d0bc4dd2d5974 (diff)
downloadQt-419079fb47c90d487b4e1f42029b70d5ec8f0d2d.zip
Qt-419079fb47c90d487b4e1f42029b70d5ec8f0d2d.tar.gz
Qt-419079fb47c90d487b4e1f42029b70d5ec8f0d2d.tar.bz2
Fix QMacStyle subControlRect()-reporting for CC_SpinBox
The mac style ignored the QAbstractSpinBox::NoButtons flag for the SC_SpinBoxEditField sub-control, effectivly always making room for the spinner buttons. Now it's in line with both the Cleanlooks style and the Windows (common) style. Reviewed-by: Jens Bache-Wiig <jbache@trolltech.com>
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/styles/qmacstyle_mac.mm12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/gui/styles/qmacstyle_mac.mm b/src/gui/styles/qmacstyle_mac.mm
index 2f93034..235cba6 100644
--- a/src/gui/styles/qmacstyle_mac.mm
+++ b/src/gui/styles/qmacstyle_mac.mm
@@ -5510,9 +5510,15 @@ QRect QMacStyle::subControlRect(ComplexControl cc, const QStyleOptionComplex *op
break;
}
case SC_SpinBoxEditField:
- ret.setRect(fw, fw,
- spin->rect.width() - spinner_w - fw * 2 - spinBoxSep,
- spin->rect.height() - fw * 2);
+ if (spin->buttonSymbols == QAbstractSpinBox::NoButtons) {
+ ret.setRect(fw, fw,
+ spin->rect.width() - fw * 2,
+ spin->rect.height() - fw * 2);
+ } else {
+ ret.setRect(fw, fw,
+ spin->rect.width() - fw * 2 - spinBoxSep - spinner_w,
+ spin->rect.height() - fw * 2);
+ }
ret = visualRect(spin->direction, spin->rect, ret);
break;
default: