summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2011-04-03 12:38:58 +0200
committerAndrea Diamantini <adjam7@gmail.com>2011-04-03 12:38:58 +0200
commit905c7e9c391f371d68fc646cd64ddc24055ed40b (patch)
tree8968eea899e9c21fa89c652d9c3949247dc3b809
parentRekonq 0.7 first stable release, yeah!! (diff)
downloadrekonq-905c7e9c391f371d68fc646cd64ddc24055ed40b.tar.xz
This commit aims to fix a long standing rekonq bug about scrollbar (and webview in general)
theme. The right way to do it seems be using a local .css file. Letting this be in master for one week (at least) before backporting...
-rw-r--r--src/application.cpp9
-rw-r--r--src/data/CMakeLists.txt1
-rw-r--r--src/data/default_rekonq.css10
-rw-r--r--src/webview.cpp16
4 files changed, 16 insertions, 20 deletions
diff --git a/src/application.cpp b/src/application.cpp
index 7fcbfe86..1fe936f3 100644
--- a/src/application.cpp
+++ b/src/application.cpp
@@ -514,10 +514,11 @@ void Application::updateConfiguration()
QWebSettings::setOfflineStorageDefaultQuota(50000);
}
- // Applies user defined CSS to all open webpages. If there no longer is a
- // user defined CSS removes it from all open webpages.
- if (!ReKonfig::userCSS().isEmpty())
- defaultSettings->setUserStyleSheetUrl(ReKonfig::userCSS());
+ // Applies user/system defined CSS to all open webpages.
+ ReKonfig::userCSS().isEmpty()
+ ? defaultSettings->setUserStyleSheetUrl(KUrl(KStandardDirs::locate("appdata" , "default_rekonq.css")))
+ : defaultSettings->setUserStyleSheetUrl(ReKonfig::userCSS())
+ ;
// ====== load Settings on main classes
historyManager()->loadSettings();
diff --git a/src/data/CMakeLists.txt b/src/data/CMakeLists.txt
index cde938c3..6aef22ec 100644
--- a/src/data/CMakeLists.txt
+++ b/src/data/CMakeLists.txt
@@ -11,6 +11,7 @@ INSTALL(
INSTALL(
FILES
defaultbookmarks.xbel
+ default_rekonq.css
DESTINATION ${DATA_INSTALL_DIR}/rekonq
)
diff --git a/src/data/default_rekonq.css b/src/data/default_rekonq.css
new file mode 100644
index 00000000..0ba6036c
--- /dev/null
+++ b/src/data/default_rekonq.css
@@ -0,0 +1,10 @@
+/*
+ * rekonq default css properties
+ * this file will not be considered
+ * setting a local stylesheet in rekonq config
+ */
+
+/* Set background color to white for sites forgetting this */
+body{
+background-color:#FFFFFF;
+}
diff --git a/src/webview.cpp b/src/webview.cpp
index 91910970..72951698 100644
--- a/src/webview.cpp
+++ b/src/webview.cpp
@@ -59,7 +59,6 @@
#include <QtGui/QClipboard>
#include <QtGui/QContextMenuEvent>
-#include <QtGui/QWindowsStyle>
#include <QtWebKit/QWebFrame>
#include <QtWebKit/QWebHistory>
@@ -81,21 +80,6 @@ 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::ButtonText).lightness() > 50) //if it is a dark theme
- {
- QWindowsStyle s;
- p = s.standardPalette();
- setPalette(p);
- }
-
// download system
connect(this, SIGNAL(linkShiftClicked(const KUrl &)), page, SLOT(downloadUrl(const KUrl &)));