2020-12-28 17:26:56 +01:00
|
|
|
import QtQuick 2.14
|
|
|
|
import QtWebEngine 1.8
|
|
|
|
import ScreenPlayWallpaper 1.0
|
|
|
|
|
|
|
|
Item {
|
|
|
|
id: root
|
2021-05-16 19:37:55 +02:00
|
|
|
|
2021-01-23 11:34:46 +01:00
|
|
|
property string url
|
2020-12-28 17:26:56 +01:00
|
|
|
|
2021-05-16 19:37:55 +02:00
|
|
|
signal requestFadeIn()
|
2020-12-28 17:26:56 +01:00
|
|
|
|
|
|
|
Component.onCompleted: {
|
2021-05-16 19:37:55 +02:00
|
|
|
WebEngine.settings.localContentCanAccessFileUrls = true;
|
|
|
|
WebEngine.settings.localContentCanAccessRemoteUrls = true;
|
|
|
|
WebEngine.settings.allowRunningInsecureContent = true;
|
|
|
|
WebEngine.settings.accelerated2dCanvasEnabled = true;
|
|
|
|
WebEngine.settings.javascriptCanOpenWindows = false;
|
|
|
|
WebEngine.settings.showScrollBars = false;
|
|
|
|
WebEngine.settings.playbackRequiresUserGesture = false;
|
|
|
|
WebEngine.settings.focusOnNavigationEnabled = true;
|
2020-12-28 17:26:56 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
WebEngineView {
|
|
|
|
id: webView
|
2021-05-16 19:37:55 +02:00
|
|
|
|
2020-12-28 17:26:56 +01:00
|
|
|
anchors.fill: parent
|
2021-01-23 11:34:46 +01:00
|
|
|
url: root.url
|
2020-12-28 17:26:56 +01:00
|
|
|
onJavaScriptConsoleMessage: print(lineNumber, message)
|
|
|
|
onLoadProgressChanged: {
|
2021-05-16 19:37:55 +02:00
|
|
|
if ((loadProgress === 100))
|
|
|
|
root.requestFadeIn();
|
|
|
|
|
2020-12-28 17:26:56 +01:00
|
|
|
}
|
|
|
|
}
|
2021-05-16 19:37:55 +02:00
|
|
|
|
2020-12-28 17:26:56 +01:00
|
|
|
}
|