From a89a9a8ddce4e5f4ba96835876f304bd0f3ece65 Mon Sep 17 00:00:00 2001 From: David Rosca Date: Sat, 24 Feb 2018 18:00:53 +0100 Subject: [PATCH] WebView: Add support for changing default background color BUG: 390316 --- src/lib/webengine/webview.cpp | 4 ++++ themes/chrome/main.css | 6 ++++++ themes/linux/main.css | 6 ++++++ themes/mac/main.css | 6 ++++++ themes/windows/main.css | 6 ++++++ 5 files changed, 28 insertions(+) diff --git a/src/lib/webengine/webview.cpp b/src/lib/webengine/webview.cpp index 773162141..6db0c7706 100644 --- a/src/lib/webengine/webview.cpp +++ b/src/lib/webengine/webview.cpp @@ -49,6 +49,7 @@ #include #include #include +#include bool WebView::s_forceContextMenuOnMouseRelease = false; @@ -86,6 +87,9 @@ WebView::WebView(QWidget* parent) return; } m_rwhvqt->installEventFilter(this); + if (QQuickWidget *w = qobject_cast(m_rwhvqt)) { + w->setClearColor(palette().color(QPalette::Window)); + } }); }); } diff --git a/themes/chrome/main.css b/themes/chrome/main.css index cab6db3d8..ff658cc99 100644 --- a/themes/chrome/main.css +++ b/themes/chrome/main.css @@ -345,3 +345,9 @@ QFrame[js-frame2="true"] border-top: 0px; background-color: #f3f3f3; } + +/*WebView*/ +WebView +{ + background: white; +} diff --git a/themes/linux/main.css b/themes/linux/main.css index 9bf664f49..8751f9fcb 100644 --- a/themes/linux/main.css +++ b/themes/linux/main.css @@ -274,3 +274,9 @@ QFrame[js-frame2="true"] border-top: 0px; background-color: #f3f3f3; } + +/*WebView*/ +WebView +{ + background: white; +} diff --git a/themes/mac/main.css b/themes/mac/main.css index 39193ddc2..53aa1fd7a 100644 --- a/themes/mac/main.css +++ b/themes/mac/main.css @@ -349,3 +349,9 @@ QFrame[js-frame2="true"] border-top: 0px; background-color: #f3f3f3; } + +/*WebView*/ +WebView +{ + background: white; +} diff --git a/themes/windows/main.css b/themes/windows/main.css index 4a942894d..280bab95b 100644 --- a/themes/windows/main.css +++ b/themes/windows/main.css @@ -436,3 +436,9 @@ QFrame[js-frame2="true"] border-top: 0px; background-color: #f3f3f3; } + +/*WebView*/ +WebView +{ + background: white; +}