summaryrefslogtreecommitdiffstats
path: root/src/gui/styles
diff options
context:
space:
mode:
authorSami Merila <sami.merila@nokia.com>2009-12-23 11:37:50 (GMT)
committerSami Merila <sami.merila@nokia.com>2009-12-23 11:37:50 (GMT)
commit7eb0abe8cd9f810905ec079e45ece1ed7fc9b9aa (patch)
treef589889eeee100b2c211b9b7e489be26e3e24985 /src/gui/styles
parent6928ffb7533d23f0be220116a7b11d90bee72fb5 (diff)
downloadQt-7eb0abe8cd9f810905ec079e45ece1ed7fc9b9aa.zip
Qt-7eb0abe8cd9f810905ec079e45ece1ed7fc9b9aa.tar.gz
Qt-7eb0abe8cd9f810905ec079e45ece1ed7fc9b9aa.tar.bz2
Setting background color to a QDialog doesn't work
Since dialogs use their own theme graphics for background, regular method of checking the palette fails (as generic background brush is probably unchanged). Therefore to check if the dialog background is using default (=theme graphic), it needs to check the cache key value of background - so that it matches with the one in stored theme palette. Task-number: QTBUG-5898 Reviewed-by: Janne Koskinen
Diffstat (limited to 'src/gui/styles')
-rw-r--r--src/gui/styles/qs60style.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp
index b386c28..e370ed0 100644
--- a/src/gui/styles/qs60style.cpp
+++ b/src/gui/styles/qs60style.cpp
@@ -2160,7 +2160,10 @@ void QS60Style::drawPrimitive(PrimitiveElement element, const QStyleOption *opti
|| qobject_cast<const QMenu *> (widget)
#endif //QT_NO_MENU
) {
- if (QS60StylePrivate::canDrawThemeBackground(option->palette.base()))
+ //Need extra check since dialogs have their own theme background
+ if (QS60StylePrivate::canDrawThemeBackground(option->palette.base()) &&
+ option->palette.window().texture().cacheKey() ==
+ QS60StylePrivate::m_themePalette->window().texture().cacheKey())
QS60StylePrivate::drawSkinElement(QS60StylePrivate::SE_OptionsMenu, painter, option->rect, flags);
else
commonStyleDraws = true;