diff options
author | J-P Nurmi <jpnurmi@digia.com> | 2014-06-28 15:47:58 +0200 |
---|---|---|
committer | J-P Nurmi <jpnurmi@digia.com> | 2014-06-30 14:57:40 +0200 |
commit | 5de4ed9db38c7a1a480e5979c2bb3b0340c8a230 (patch) | |
tree | 4df6b9293e13f0bab3916993c319982f4bd0ead1 /src/widgets/styles/qstylehelper.cpp | |
parent | 8638895f6be4bd6566e771603a42f9f99b0c1d97 (diff) |
QMac/FusionStyle: fix the background color for transient scrollbars
Task-number: QTBUG-39922
Change-Id: I4b313296ae845bc9e116494aa66c577b432b4a67
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
Diffstat (limited to 'src/widgets/styles/qstylehelper.cpp')
-rw-r--r-- | src/widgets/styles/qstylehelper.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/widgets/styles/qstylehelper.cpp b/src/widgets/styles/qstylehelper.cpp index fc73488154..6be07a3f45 100644 --- a/src/widgets/styles/qstylehelper.cpp +++ b/src/widgets/styles/qstylehelper.cpp @@ -45,6 +45,8 @@ #include <private/qmath_p.h> #include <private/qstyle_p.h> #include <qmath.h> +#include <qscrollbar.h> +#include <qabstractscrollarea.h> #include "qstylehelper_p.h" #include <qstringbuilder.h> @@ -387,5 +389,13 @@ void drawBorderPixmap(const QPixmap &pixmap, QPainter *painter, const QRect &rec } } + +QColor backgroundColor(const QPalette &pal, const QWidget* widget) +{ + if (qobject_cast<const QScrollBar *>(widget) && widget->parent() && + qobject_cast<const QAbstractScrollArea *>(widget->parent()->parent())) + return widget->parentWidget()->parentWidget()->palette().color(QPalette::Base); + return pal.color(QPalette::Base); +} } QT_END_NAMESPACE |