diff options
author | Tor Arne Vestbø <tor.arne.vestbo@nokia.com> | 2009-08-06 09:15:20 (GMT) |
---|---|---|
committer | Tor Arne Vestbø <tor.arne.vestbo@nokia.com> | 2009-08-06 11:01:19 (GMT) |
commit | 419079fb47c90d487b4e1f42029b70d5ec8f0d2d (patch) | |
tree | 700a82d76c1b08ff4604eafdcb4a922ef4326699 /src/gui/styles/qmacstyle_mac.mm | |
parent | 97ee0644d4a0c3e03e835c07d99d0bc4dd2d5974 (diff) | |
download | Qt-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/styles/qmacstyle_mac.mm')
-rw-r--r-- | src/gui/styles/qmacstyle_mac.mm | 12 |
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: |