From 5e2bc6953fe6923165b8a5d7679939693a1d58d6 Mon Sep 17 00:00:00 2001 From: Steve Block Date: Fri, 5 Feb 2010 14:27:46 +0000 Subject: Merge webkit.org at r54340 : Initial merge by git Change-Id: Ib489d2ff91186ea3652522e1d586e54416a2cf44 --- WebCore/platform/qt/RenderThemeQt.cpp | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) (limited to 'WebCore/platform/qt/RenderThemeQt.cpp') diff --git a/WebCore/platform/qt/RenderThemeQt.cpp b/WebCore/platform/qt/RenderThemeQt.cpp index 83e3746..271c11a 100644 --- a/WebCore/platform/qt/RenderThemeQt.cpp +++ b/WebCore/platform/qt/RenderThemeQt.cpp @@ -129,7 +129,6 @@ PassRefPtr RenderTheme::themeForPage(Page* page) RenderThemeQt::RenderThemeQt(Page* page) : RenderTheme() , m_page(page) - , m_fallbackStyle(0) { QPushButton button; button.setAttribute(Qt::WA_MacSmallSize); @@ -139,6 +138,8 @@ RenderThemeQt::RenderThemeQt(Page* page) #ifdef Q_WS_MAC m_buttonFontPixelSize = fontInfo.pixelSize(); #endif + + m_fallbackStyle = QStyleFactory::create(QLatin1String("windows")); } RenderThemeQt::~RenderThemeQt() @@ -147,19 +148,17 @@ RenderThemeQt::~RenderThemeQt() } // for some widget painting, we need to fallback to Windows style -QStyle* RenderThemeQt::fallbackStyle() +QStyle* RenderThemeQt::fallbackStyle() const { - if (!m_fallbackStyle) - m_fallbackStyle = QStyleFactory::create(QLatin1String("windows")); - - if (!m_fallbackStyle) - m_fallbackStyle = QApplication::style(); - - return m_fallbackStyle; + return (m_fallbackStyle) ? m_fallbackStyle : QApplication::style(); } QStyle* RenderThemeQt::qStyle() const { +#ifdef Q_WS_MAEMO_5 + return fallbackStyle(); +#endif + if (m_page) { QWebPageClient* pageClient = m_page->chrome()->client()->platformPageClient(); @@ -773,6 +772,11 @@ bool RenderThemeQt::supportsFocus(ControlPart appearance) const void RenderThemeQt::setPaletteFromPageClientIfExists(QPalette& palette) const { +#ifdef Q_WS_MAEMO_5 + static QPalette lightGrayPalette(Qt::lightGray); + palette = lightGrayPalette; + return; +#endif // If the webview has a custom palette, use it if (!m_page) return; -- cgit v1.1