Skip to content
Permalink
Browse files
2010-02-01 Andreas Kling <andreas.kling@nokia.com>
        Reviewed by Kenneth Rohde Christiansen.

        [Qt] Use the fallback style on Maemo 5

        https://bugs.webkit.org/show_bug.cgi?id=34376

        * platform/qt/RenderThemeQt.cpp:
        (WebCore::RenderThemeQt::RenderThemeQt):
        (WebCore::RenderThemeQt::fallbackStyle):
        (WebCore::RenderThemeQt::qStyle):
        (WebCore::RenderThemeQt::setPaletteFromPageClientIfExists):
        * platform/qt/RenderThemeQt.h:

Canonical link: https://commits.webkit.org/45531@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@54180 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
eseidel committed Feb 2, 2010
1 parent a86d038 commit 2a6000a354ea6583838252f23fcb8346f1c0b77a
Showing with 29 additions and 10 deletions.
  1. +15 −0 WebCore/ChangeLog
  2. +13 −9 WebCore/platform/qt/RenderThemeQt.cpp
  3. +1 −1 WebCore/platform/qt/RenderThemeQt.h
@@ -1,3 +1,18 @@
2010-02-01 Andreas Kling <andreas.kling@nokia.com>

Reviewed by Kenneth Rohde Christiansen.

[Qt] Use the fallback style on Maemo 5

https://bugs.webkit.org/show_bug.cgi?id=34376

* platform/qt/RenderThemeQt.cpp:
(WebCore::RenderThemeQt::RenderThemeQt):
(WebCore::RenderThemeQt::fallbackStyle):
(WebCore::RenderThemeQt::qStyle):
(WebCore::RenderThemeQt::setPaletteFromPageClientIfExists):
* platform/qt/RenderThemeQt.h:

2010-02-01 Kavita Kanetkar <kkanetkar@chromium.org>

Reviewed by Nate Chapin.
@@ -129,7 +129,6 @@ PassRefPtr<RenderTheme> 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;
@@ -145,7 +145,7 @@ class RenderThemeQt : public RenderTheme {

void setPaletteFromPageClientIfExists(QPalette&) const;

QStyle* fallbackStyle();
QStyle* fallbackStyle() const;

Page* m_page;

0 comments on commit 2a6000a

Please sign in to comment.