1
0
mirror of https://gitlab.com/kelteseth/ScreenPlay.git synced 2024-11-07 03:22:33 +01:00
ScreenPlay/ScreenPlayWallpaper/qml/WebsiteWallpaper.qml

37 lines
964 B
QML
Raw Normal View History

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
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
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
}