diff options
author | Andrea Diamantini <adjam7@gmail.com> | 2010-06-15 18:50:25 +0200 |
---|---|---|
committer | Andrea Diamantini <adjam7@gmail.com> | 2010-06-15 18:50:25 +0200 |
commit | 3b83eb0769ccb926976c0f4c2514d4de3917f054 (patch) | |
tree | f8dc01ef57b2909075de766d492f19448a9ef55d /src/webview.cpp | |
parent | no more currenttab & digit closed tabs (diff) | |
download | rekonq-3b83eb0769ccb926976c0f4c2514d4de3917f054.tar.xz |
This dangerous commit, 15 days to the release, removes the use of a default.css
file in rekonq and does an hack to choose the right palette for the WebView.
- Why this doesn't work in QWebPage::setPalette()??
- Why using a KStyle things don't work as expected??
- so, where is really the bug, here? I have some ideas about but I currently have no time to work on..
Anyway, with this nice hack :) things seem work well for dark themes and for pages
without a "proper" style (See bug 232552 about..)
Many thanks to Tomas Fryda for let me noticing this.
Diffstat (limited to 'src/webview.cpp')
-rw-r--r-- | src/webview.cpp | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/webview.cpp b/src/webview.cpp index 0633bc9b..7fc1b4b8 100644 --- a/src/webview.cpp +++ b/src/webview.cpp @@ -57,6 +57,7 @@ #include <QtGui/QClipboard> #include <QtGui/QKeyEvent> #include <QtGui/QLayout> +#include <QtGui/QWindowsStyle> #include <QtDBus/QDBusConnectionInterface> #include <QtDBus/QDBusInterface> @@ -74,7 +75,21 @@ WebView::WebView(QWidget* parent) { WebPage *page = new WebPage(this); setPage(page); - + + // // NOTE This is a lot hackish. We copied it from Arora, but using a "Windows Style" + // // seems really a pity to me. The problem is that using a KStyle everything seems "broken" + // // (at least with dark colors). So I think the code should be somthing like: + // KStyle s; + // setPalette( s.standardPalette() ); + // // But it doesn't work :( + // // We'll see in next KDE releases... + QPalette p; + if (p.color(QPalette::Window) != Qt::white) { + QWindowsStyle s; + p = s.standardPalette(); + setPalette(p); + } + // download system connect(this, SIGNAL(linkShiftClicked(const KUrl &)), page, SLOT(downloadUrl(const KUrl &))); connect(page, SIGNAL(downloadRequested(const QNetworkRequest &)), page, SLOT(downloadRequest(const QNetworkRequest &))); |