mirror of
https://gitlab.com/kelteseth/ScreenPlay.git
synced 2024-11-25 12:13:00 +01:00
Fix wallpaper path
This commit is contained in:
parent
22ef3494e0
commit
54154ad09b
@ -13,10 +13,11 @@
|
||||
margin: 0px;
|
||||
padding: 0px;
|
||||
overflow: hidden;
|
||||
background:black;
|
||||
}
|
||||
#errorMsg{
|
||||
position: fixed;
|
||||
top: 0;
|
||||
top: 50%;
|
||||
text-align: center;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
@ -29,10 +30,9 @@
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<h2 id="errorMsg">If you can read this something went wrong. Oh well....</h2>
|
||||
<video id="videoPlayer" oncontextmenu="return false;" width="100%" height="100%" loop autoplay>
|
||||
<source id="videoSource" src="" type="video/webm" oncontextmenu="return false;" width="100%" height="100%"> Your browser does not support the video tag.
|
||||
<source id="videoSource" type="video/webm" oncontextmenu="return false;" width="100%" height="100%"> Your browser does not support the video tag. WTF?
|
||||
</video>
|
||||
</body>
|
||||
</html>
|
||||
|
@ -1,11 +1,11 @@
|
||||
import QtQuick 2.12
|
||||
import QtWebEngine 1.7
|
||||
import QtWebEngine 1.8
|
||||
import net.aimber.wallpaper 1.0
|
||||
|
||||
Rectangle {
|
||||
anchors.fill: parent
|
||||
color: {
|
||||
if(desktopProperties.color === null){
|
||||
if (desktopProperties.color === null) {
|
||||
return "black"
|
||||
} else {
|
||||
return desktopProperties.color
|
||||
@ -15,6 +15,7 @@ Rectangle {
|
||||
property bool canFadeIn: true
|
||||
|
||||
Component.onCompleted: {
|
||||
|
||||
WebEngine.settings.allowRunningInsecureContent = true
|
||||
WebEngine.settings.accelerated2dCanvasEnabled = true
|
||||
WebEngine.settings.javascriptCanOpenWindows = false
|
||||
@ -24,9 +25,9 @@ Rectangle {
|
||||
|
||||
switch (window.type) {
|
||||
case Wallpaper.WallpaperType.Video:
|
||||
webView.enabled = true
|
||||
webView.url = Qt.resolvedUrl(window.getApplicationPath(
|
||||
) + "/index.html")
|
||||
webView.enabled = true
|
||||
|
||||
break
|
||||
case Wallpaper.WallpaperType.Html:
|
||||
@ -44,7 +45,6 @@ Rectangle {
|
||||
}
|
||||
|
||||
function fadeIn() {
|
||||
|
||||
window.setVisible(true)
|
||||
if (canFadeIn) {
|
||||
animFadeIn.start()
|
||||
@ -53,31 +53,34 @@ Rectangle {
|
||||
}
|
||||
}
|
||||
|
||||
Loader {
|
||||
id: loader
|
||||
anchors.fill: parent
|
||||
}
|
||||
|
||||
WebEngineView {
|
||||
id: webView
|
||||
enabled: true
|
||||
enabled: false
|
||||
anchors.fill: parent
|
||||
onLoadProgressChanged: {
|
||||
|
||||
if (loadProgress === 100) {
|
||||
|
||||
var src = ""
|
||||
src += "var videoPlayer = document.getElementById('videoPlayer');"
|
||||
src += "var videoSource = document.getElementById('videoSource');"
|
||||
src += "videoSource.src = 'file:///" + window.fullContentPath + "';"
|
||||
src += "videoSource.src = '" + window.fullContentPath + "';"
|
||||
src += "videoPlayer.load();"
|
||||
src += "videoPlayer.volume = " + window.volume + ";"
|
||||
src += "videoPlayer.play();"
|
||||
|
||||
webView.runJavaScript(src, function () {
|
||||
webView.runJavaScript(src, function (result) {
|
||||
fadeIn()
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
Loader {
|
||||
id: loader
|
||||
anchors.fill: parent
|
||||
source: "qrc:/test.qml"
|
||||
|
||||
onJavaScriptConsoleMessage: print(lineNumber, message)
|
||||
}
|
||||
|
||||
OpacityAnimator {
|
||||
@ -171,5 +174,4 @@ Rectangle {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -103,7 +103,7 @@ public slots:
|
||||
}
|
||||
void setVolume(float volume)
|
||||
{
|
||||
qWarning("Floating point comparison needs context sanity check");
|
||||
|
||||
if (qFuzzyCompare(m_volume, volume))
|
||||
return;
|
||||
|
||||
|
@ -60,7 +60,7 @@ WinWindow::WinWindow(QVector<int>& activeScreensList, QString projectPath, QStri
|
||||
m_window.setSource(QUrl("qrc:/mainWindow.qml"));
|
||||
|
||||
// Let QML decide when were are read to show the window
|
||||
//ShowWindow(m_windowHandle, SW_HIDE);
|
||||
ShowWindow(m_windowHandle, SW_HIDE);
|
||||
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user