summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Bache-Wiig <jens.bache-wiig@digia.com>2014-03-03 14:28:35 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-03-03 16:49:09 +0100
commita0dccdd0ac7be39d8cdb8aa1f12c1771b11213ae (patch)
treee1902f1344d39ab745c5a48ae7a558956b148afd
parentbe37e3123808be44170beeea413b97ef9a312ef2 (diff)
downloadqtquickcontrols-a0dccdd0ac7be39d8cdb8aa1f12c1771b11213ae.tar.gz
Fix gray SpinBox background on mac
This is a regression caused by removing the fillrect for SpinBoxStyle itself. Change-Id: Ibab509634a12aec591d2d031a0e735d602b388c6 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
-rw-r--r--src/controls/Private/qquickstyleitem.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/controls/Private/qquickstyleitem.cpp b/src/controls/Private/qquickstyleitem.cpp
index 21de9819..5b7e6728 100644
--- a/src/controls/Private/qquickstyleitem.cpp
+++ b/src/controls/Private/qquickstyleitem.cpp
@@ -1534,6 +1534,15 @@ void QQuickStyleItem::paint(QPainter *painter)
painter->setPen(pen);
} break;
case SpinBox:
+#ifdef Q_OS_MAC
+ // macstyle depends on the embedded qlineedit to fill the editfield background
+ if (style() == "mac") {
+ QRect editRect = qApp->style()->subControlRect(QStyle::CC_SpinBox,
+ qstyleoption_cast<QStyleOptionComplex*>(m_styleoption),
+ QStyle::SC_SpinBoxEditField);
+ painter->fillRect(editRect.adjusted(-1, -1, 1, 1), m_styleoption->palette.base());
+ }
+#endif
qApp->style()->drawComplexControl(QStyle::CC_SpinBox,
qstyleoption_cast<QStyleOptionComplex*>(m_styleoption),
painter);