diff options
author | Benjamin Poulain <benjamin.poulain@nokia.com> | 2009-08-20 11:12:30 (GMT) |
---|---|---|
committer | Benjamin Poulain <benjamin.poulain@nokia.com> | 2009-08-20 11:16:52 (GMT) |
commit | 2717f89d2b51c2eb3bc742a64d18a0941fd4b6d7 (patch) | |
tree | 5d16872ad928f11833c2c2a3626564e282398929 /src/gui/styles | |
parent | 72629a807c71f9b2c282ff5f67994ec3fab78b7f (diff) | |
download | Qt-2717f89d2b51c2eb3bc742a64d18a0941fd4b6d7.zip Qt-2717f89d2b51c2eb3bc742a64d18a0941fd4b6d7.tar.gz Qt-2717f89d2b51c2eb3bc742a64d18a0941fd4b6d7.tar.bz2 |
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
Diffstat (limited to 'src/gui/styles')
-rw-r--r-- | src/gui/styles/qmacstyle_mac.mm | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/gui/styles/qmacstyle_mac.mm b/src/gui/styles/qmacstyle_mac.mm index 82e0b34..649e8e7 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: |