diff options
author | Sami Merilä <sami.merila@nokia.com> | 2009-06-18 11:34:11 (GMT) |
---|---|---|
committer | Sami Merilä <sami.merila@nokia.com> | 2009-06-18 11:34:11 (GMT) |
commit | 553a0a8fb83b8ff82574e9b0831ba56d0fd93054 (patch) | |
tree | 6424165ae74619d28f5a511001ad2200c03af091 /src/gui | |
parent | 9ad849c8520e3a1efe47f1f67fb675c8e7754054 (diff) | |
download | Qt-553a0a8fb83b8ff82574e9b0831ba56d0fd93054.zip Qt-553a0a8fb83b8ff82574e9b0831ba56d0fd93054.tar.gz Qt-553a0a8fb83b8ff82574e9b0831ba56d0fd93054.tar.bz2 |
S60Style: Palette has gets cleared when setting themePalette.
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/styles/qs60style.cpp | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp index d2bd679..b80adc2 100644 --- a/src/gui/styles/qs60style.cpp +++ b/src/gui/styles/qs60style.cpp @@ -478,7 +478,9 @@ void QS60StylePrivate::setThemePalette(QApplication *app) const Q_UNUSED(app) QPalette widgetPalette = QPalette(Qt::white); setThemePalette(&widgetPalette); - QApplication::setPalette(widgetPalette); + QApplication::setPalette(widgetPalette); //calling QApplication::setPalette clears palette hash + setThemePaletteHash(&widgetPalette); + storeThemePalette(&widgetPalette); } void QS60StylePrivate::setThemePalette(QStyleOption *option) const @@ -664,7 +666,7 @@ void QS60StylePrivate::setThemePalette(QWidget *widget) const { if(!widget) return; - QPalette widgetPalette = widget->palette(); + QPalette widgetPalette = QApplication::palette(widget); //header view and its viewport need to be set 100% transparent button color, since drawing code will //draw transparent theme graphics to table column and row headers. @@ -716,9 +718,6 @@ 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); - - setThemePaletteHash(palette); - storeThemePalette(palette); } void QS60StylePrivate::deleteThemePalette() @@ -791,6 +790,18 @@ void QS60StylePrivate::setThemePaletteHash(QPalette *palette) const QApplication::setPalette(widgetPalette, "QLineEdit"); widgetPalette = *palette; + widgetPalette.setColor(QPalette::All, QPalette::Text, + s60Color(QS60StyleEnums::CL_QsnTextColors, 34, 0)); + widgetPalette.setColor(QPalette::All, QPalette::HighlightedText, + s60Color(QS60StyleEnums::CL_QsnTextColors, 24, 0)); + QApplication::setPalette(widgetPalette, "QTextEdit"); + widgetPalette = *palette; + + widgetPalette.setColor(QPalette::All, QPalette::HighlightedText, + s60Color(QS60StyleEnums::CL_QsnTextColors, 24, 0)); + QApplication::setPalette(widgetPalette, "QComboBox"); + widgetPalette = *palette; + widgetPalette.setColor(QPalette::WindowText, mainAreaTextColor); widgetPalette.setColor(QPalette::Button, QApplication::palette().color(QPalette::Button)); widgetPalette.setColor(QPalette::Dark, mainAreaTextColor.darker()); @@ -1662,7 +1673,7 @@ void QS60Style::drawControl(ControlElement element, const QStyleOption *option, case CE_MenuItem: if (const QStyleOptionMenuItem *menuItem = qstyleoption_cast<const QStyleOptionMenuItem *>(option)) { QStyleOptionMenuItem optionMenuItem = *menuItem; - + bool drawSubMenuIndicator = false; switch(menuItem->menuItemType) { case QStyleOptionMenuItem::Scroller: |