summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenjamin Poulain <benjamin.poulain@nokia.com>2009-08-20 13:12:30 +0200
committerBenjamin Poulain <benjamin.poulain@nokia.com>2009-08-20 13:16:52 +0200
commit2717f89d2b51c2eb3bc742a64d18a0941fd4b6d7 (patch)
tree5d16872ad928f11833c2c2a3626564e282398929
parent72629a807c71f9b2c282ff5f67994ec3fab78b7f (diff)
Fix the painting of QSpinBox on Mac when the buttons are disabled
The edit area of the spinbox should take complete surface of the widget when the button symbol is QAbstractSpinBox::NoButtons. Reviewed-by: Richard Moe Gustavsen
-rw-r--r--src/gui/styles/qmacstyle_mac.mm11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/gui/styles/qmacstyle_mac.mm b/src/gui/styles/qmacstyle_mac.mm
index 82e0b34d5..649e8e735 100644
--- a/src/gui/styles/qmacstyle_mac.mm
+++ b/src/gui/styles/qmacstyle_mac.mm
@@ -5687,9 +5687,14 @@ 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() - spinner_w - fw * 2 - spinBoxSep,
+ spin->rect.height() - fw * 2);
ret = visualRect(spin->direction, spin->rect, ret);
break;
default: