From 2717f89d2b51c2eb3bc742a64d18a0941fd4b6d7 Mon Sep 17 00:00:00 2001 From: Benjamin Poulain Date: Thu, 20 Aug 2009 13:12:30 +0200 Subject: 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 --- src/gui/styles/qmacstyle_mac.mm | 11 ++++++++--- 1 file 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: -- cgit v0.12