summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSami Merilä <sami.merila@nokia.com>2009-11-16 08:26:33 (GMT)
committerSami Merilä <sami.merila@nokia.com>2009-11-16 08:26:33 (GMT)
commit15384f3017978a3d552077c8400b018efcfd793c (patch)
tree4cfe923bab899d2e55e6740730a3746d2840701b
parent85c341cee6bf3f4fa611e6d691a9156feb5d835e (diff)
downloadQt-15384f3017978a3d552077c8400b018efcfd793c.zip
Qt-15384f3017978a3d552077c8400b018efcfd793c.tar.gz
Qt-15384f3017978a3d552077c8400b018efcfd793c.tar.bz2
Define own palette for web-based widgets in QS60Style
It makes no sense to use the S60-theme based palette in web based widgets. Web pages do not generally show theme background, but their own (or by default white) which clashes badly with WindowText and Text that are set to work with theme background. Therefore, QWebView and QGraphicsWebView need to be set their own palette for texts in theme palette hash. This improves visibility of text in webkit when QS60Style is active. Task-number: QTBUG-4885 Reviewed-by: Janne Koskinen
-rw-r--r--src/gui/styles/qs60style.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp
index 939ea45..7c3e11f 100644
--- a/src/gui/styles/qs60style.cpp
+++ b/src/gui/styles/qs60style.cpp
@@ -783,6 +783,14 @@ void QS60StylePrivate::setThemePaletteHash(QPalette *palette) const
widgetPalette.setBrush(QPalette::Window, QBrush());
QApplication::setPalette(widgetPalette, "QScrollArea");
widgetPalette = *palette;
+
+ //Webpages should not use S60 theme colors as they are designed to work
+ //with themeBackground and do not generally mesh well with web page backgrounds.
+ QPalette webPalette = *palette;
+ webPalette.setColor(QPalette::WindowText, Qt::black);
+ webPalette.setColor(QPalette::Text, Qt::black);
+ QApplication::setPalette(webPalette, "QWebView");
+ QApplication::setPalette(webPalette, "QGraphicsWebView");
}
QSize QS60StylePrivate::partSize(QS60StyleEnums::SkinParts part, SkinElementFlags flags)
@@ -2007,7 +2015,7 @@ void QS60Style::drawPrimitive(PrimitiveElement element, const QStyleOption *opti
buttonRect.adjust(0,-newY,0,-newY);
painter->save();
- QColor themeColor = d->s60Color(QS60StyleEnums::CL_QsnIconColors, 13, option);
+ QColor themeColor = d->s60Color(QS60StyleEnums::CL_QsnTextColors, 6, option);
QColor buttonTextColor = option->palette.buttonText().color();
if (themeColor != buttonTextColor)
painter->setPen(buttonTextColor);