summaryrefslogtreecommitdiffstats
path: root/src/gui/styles
diff options
context:
space:
mode:
authorSami Merilä <sami.merila@nokia.com>2009-12-03 10:18:04 (GMT)
committerSami Merilä <sami.merila@nokia.com>2009-12-03 10:18:04 (GMT)
commita024829184dcde9b6fdaf5ea884fe7e42efdaf29 (patch)
tree9b6de07b50147c196cb24b134f9840bb241fb1e0 /src/gui/styles
parent01279a67d5d27089b645a4b6226e32b415709722 (diff)
downloadQt-a024829184dcde9b6fdaf5ea884fe7e42efdaf29.zip
Qt-a024829184dcde9b6fdaf5ea884fe7e42efdaf29.tar.gz
Qt-a024829184dcde9b6fdaf5ea884fe7e42efdaf29.tar.bz2
QS60Style: Always store changed theme palette
When style updates its background brush, it updates QApplication's palette with new background. Also member variable m_backgroundBrush is updated. What is NOT updated is the member variable m_themePalette, which should also contain correct updated palette. This change updates m_themePalette and moves palette updations to occur in one place so that in all use-cases the palettes are modified in a unified way. Task-number: QTBUG-6427 Reviewed-by: Alessandro Portale
Diffstat (limited to 'src/gui/styles')
-rw-r--r--src/gui/styles/qs60style.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp
index dca78ca..5f7ec69 100644
--- a/src/gui/styles/qs60style.cpp
+++ b/src/gui/styles/qs60style.cpp
@@ -454,9 +454,6 @@ void QS60StylePrivate::setThemePalette(QApplication *app) const
Q_UNUSED(app)
QPalette widgetPalette = QPalette(Qt::white);
setThemePalette(&widgetPalette);
- QApplication::setPalette(widgetPalette); //calling QApplication::setPalette clears palette hash
- setThemePaletteHash(&widgetPalette);
- storeThemePalette(&widgetPalette);
}
QPalette* QS60StylePrivate::themePalette()
@@ -470,8 +467,6 @@ void QS60StylePrivate::setBackgroundTexture(QApplication *app) const
QPalette applicationPalette = QApplication::palette();
applicationPalette.setBrush(QPalette::Window, backgroundTexture());
setThemePalette(&applicationPalette);
- QApplication::setPalette(applicationPalette);
- setThemePaletteHash(&applicationPalette);
}
void QS60StylePrivate::deleteBackground()
@@ -687,6 +682,10 @@ void QS60StylePrivate::setThemePalette(QPalette *palette) const
palette->setColor(QPalette::Midlight, palette->color(QPalette::Button).lighter(125));
palette->setColor(QPalette::Mid, palette->color(QPalette::Button).darker(150));
palette->setColor(QPalette::Shadow, Qt::black);
+
+ QApplication::setPalette(*palette); //calling QApplication::setPalette clears palette hash
+ setThemePaletteHash(palette);
+ storeThemePalette(palette);
}
void QS60StylePrivate::deleteThemePalette()