From 1273c96b5583e80194f974c0feaf927b847d2861 Mon Sep 17 00:00:00 2001 From: Cqoicebordel Date: Sun, 21 Jun 2020 19:45:54 +0200 Subject: [PATCH] Special build for plasma 5.19+ Remove the Webkit dependancy, and remove a few features, are they will not work anymore. --- cqcb.plasma.webslice/contents/config/main.xml | 4 ++-- .../contents/ui/ConfigAdvanced.qml | 4 ++++ .../contents/ui/ConfigGeneral.qml | 3 +++ .../contents/ui/ConfigMultipleURLs.qml | 3 +++ cqcb.plasma.webslice/contents/ui/main.qml | 20 ++++++++++--------- 5 files changed, 23 insertions(+), 11 deletions(-) diff --git a/cqcb.plasma.webslice/contents/config/main.xml b/cqcb.plasma.webslice/contents/config/main.xml index 366cd71..a0702eb 100644 --- a/cqcb.plasma.webslice/contents/config/main.xml +++ b/cqcb.plasma.webslice/contents/config/main.xml @@ -16,7 +16,7 @@ 3600 - true + false true @@ -31,7 +31,7 @@ 500 - true + false diff --git a/cqcb.plasma.webslice/contents/ui/ConfigAdvanced.qml b/cqcb.plasma.webslice/contents/ui/ConfigAdvanced.qml index 3487541..6e8d6f9 100644 --- a/cqcb.plasma.webslice/contents/ui/ConfigAdvanced.qml +++ b/cqcb.plasma.webslice/contents/ui/ConfigAdvanced.qml @@ -48,6 +48,7 @@ Item { Label { text: i18n('Minimum Content width :') + enabled:false } SpinBox { @@ -56,12 +57,14 @@ Item { minimumValue: 1 maximumValue: 10000 Layout.columnSpan: 1 + enabled:false } Label { font.italic: true text: i18n('(default : 100px)') Layout.columnSpan: 1 + enabled:false } Label { @@ -69,6 +72,7 @@ Item { text: i18n('This option can help you trigger media queries, and may help with zoom.') Layout.preferredWidth: 0 Layout.columnSpan: 3 + enabled:false } Item { diff --git a/cqcb.plasma.webslice/contents/ui/ConfigGeneral.qml b/cqcb.plasma.webslice/contents/ui/ConfigGeneral.qml index 7ca1b7d..db8efa7 100644 --- a/cqcb.plasma.webslice/contents/ui/ConfigGeneral.qml +++ b/cqcb.plasma.webslice/contents/ui/ConfigGeneral.qml @@ -68,12 +68,14 @@ Item { id: enableTransparency Layout.columnSpan: 3 text: i18n('Enable transparency') + enabled:false } Label { font.italic: true text: i18n('Note that the transparency will only work if the page background is also transparent or not set.\nAlso, the transparency may not be visible until the page is reloaded or repainted.') Layout.columnSpan: 3 + enabled:false } Item { @@ -167,6 +169,7 @@ Item { id: reloadAnimation Layout.columnSpan: 3 text: i18n('Display reload animation') + enabled:false } } } diff --git a/cqcb.plasma.webslice/contents/ui/ConfigMultipleURLs.qml b/cqcb.plasma.webslice/contents/ui/ConfigMultipleURLs.qml index d920e2a..b509262 100644 --- a/cqcb.plasma.webslice/contents/ui/ConfigMultipleURLs.qml +++ b/cqcb.plasma.webslice/contents/ui/ConfigMultipleURLs.qml @@ -23,6 +23,7 @@ Item { Label { text: i18n('List of URL accessible throught the context menu to switch to others websites.') + enabled:false } TableView { @@ -34,10 +35,12 @@ Item { title: i18n('URL') } height:300 + enabled:false } RowLayout { + enabled:false TextField { id: addedUrl placeholderText: i18n('URL') diff --git a/cqcb.plasma.webslice/contents/ui/main.qml b/cqcb.plasma.webslice/contents/ui/main.qml index 92e0dbb..9be65cf 100644 --- a/cqcb.plasma.webslice/contents/ui/main.qml +++ b/cqcb.plasma.webslice/contents/ui/main.qml @@ -18,11 +18,11 @@ ***************************************************************************/ import QtQuick 2.7 -import QtWebKit 3.0 +import QtWebView 1.1 //import QtWebEngine 1.5 import QtQuick.Layouts 1.1 import QtQuick.Controls 1.3 -import QtWebKit.experimental 1.0 +//import QtWebKit.experimental 1.0 import org.kde.plasma.plasmoid 2.0 import org.kde.plasma.components 2.0 as PlasmaComponents import org.kde.plasma.core 2.0 as PlasmaCore @@ -81,8 +81,8 @@ Item { id: webviewID url: websliceUrl anchors.fill: parent - experimental.preferredMinimumContentsWidth: minimumContentWidth - experimental.transparentBackground: enableTransparency + //experimental.preferredMinimumContentsWidth: minimumContentWidth + //experimental.transparentBackground: enableTransparency width: (displaySiteBehaviour) ? 0 : webPopupWidth height: (displaySiteBehaviour) ? 0 : webPopupHeight @@ -117,11 +117,13 @@ Item { */ onLoadingChanged: { if (enableJSID && loadRequest.status === WebView.LoadSucceededStatus) { - experimental.evaluateJavaScript( - jsSelector + ".scrollIntoView(true);"); + //experimental.evaluateJavaScript( + // jsSelector + ".scrollIntoView(true);"); + runJavaScript(jsSelector + ".scrollIntoView(true);"); } if (enableJS && loadRequest.status === WebView.LoadSucceededStatus) { - experimental.evaluateJavaScript(js); + //experimental.evaluateJavaScript(js); + runJavaScript(js); } if (loadRequest && loadRequest.status === WebView.LoadSucceededStatus) { busyIndicator.visible = false; @@ -132,12 +134,12 @@ Item { /** * Open the middle clicked (or ctrl+clicked) link in the default browser */ - onNavigationRequested: { + /*onNavigationRequested: { if(isExternalLink){ request.action = WebView.IgnoreRequest; Qt.openUrlExternally(request.url); } - } + }*/ /** * Display the context menu