mirror of
https://gitlab.com/kelteseth/ScreenPlay.git
synced 2024-09-18 08:22:33 +02:00
Fix fade in showing black
This commit is contained in:
parent
1d7ba6044d
commit
e258c89281
@ -11,6 +11,9 @@ Rectangle {
|
||||
border.width: 10
|
||||
border.color: "orange"
|
||||
|
||||
signal requestFadeIn
|
||||
Component.onCompleted: root.requestFadeIn()
|
||||
|
||||
property int attStrength: 800000
|
||||
//Emitter
|
||||
property bool isEnabled: true
|
||||
|
@ -28,7 +28,7 @@ Rectangle {
|
||||
|
||||
function onQmlExit() {
|
||||
if (canFadeByWallpaperFillMode && Wallpaper.canFade) {
|
||||
imgCover.state = "outExit"
|
||||
imgCover.state = "exit"
|
||||
} else {
|
||||
Wallpaper.terminate()
|
||||
}
|
||||
@ -65,7 +65,7 @@ Rectangle {
|
||||
if (oldType === InstalledType.VideoWallpaper)
|
||||
return
|
||||
|
||||
imgCover.state = "in"
|
||||
imgCover.state = "showDefaultBackgroundImage"
|
||||
loader.source = "qrc:/WebView.qml"
|
||||
}
|
||||
}
|
||||
@ -83,27 +83,28 @@ Rectangle {
|
||||
break
|
||||
case InstalledType.QMLWallpaper:
|
||||
loader.source = Qt.resolvedUrl(Wallpaper.fullContentPath)
|
||||
fadeIn()
|
||||
break
|
||||
case InstalledType.WebsiteWallpaper:
|
||||
loader.setSource("qrc:/WebsiteWallpaper.qml", {
|
||||
"url": Wallpaper.fullContentPath
|
||||
})
|
||||
fadeIn()
|
||||
break
|
||||
case InstalledType.GifWallpaper:
|
||||
loader.setSource("qrc:/GifWallpaper.qml", {
|
||||
"source": Qt.resolvedUrl(
|
||||
Wallpaper.fullContentPath)
|
||||
})
|
||||
fadeIn()
|
||||
break
|
||||
}
|
||||
|
||||
fadeIn()
|
||||
}
|
||||
|
||||
function fadeIn() {
|
||||
Wallpaper.setVisible(true)
|
||||
if (canFadeByWallpaperFillMode && Wallpaper.canFade) {
|
||||
imgCover.state = "out"
|
||||
imgCover.state = "hideDefaultBackgroundImage"
|
||||
} else {
|
||||
imgCover.opacity = 0
|
||||
}
|
||||
@ -138,35 +139,33 @@ Rectangle {
|
||||
left: parent.left
|
||||
right: parent.right
|
||||
}
|
||||
state: "in"
|
||||
state: "showDefaultBackgroundImage"
|
||||
sourceSize.width: Wallpaper.width
|
||||
sourceSize.height: Wallpaper.height
|
||||
source: {
|
||||
if (Qt.platform.os === "windows") {
|
||||
return Qt.resolvedUrl(
|
||||
"file:///" + Wallpaper.windowsDesktopProperties.wallpaperPath)
|
||||
} else {
|
||||
return ""
|
||||
}
|
||||
}
|
||||
|
||||
states: [
|
||||
State {
|
||||
name: "in"
|
||||
name: "showDefaultBackgroundImage"
|
||||
PropertyChanges {
|
||||
target: imgCover
|
||||
opacity: 1
|
||||
}
|
||||
},
|
||||
State {
|
||||
name: "out"
|
||||
name: "hideDefaultBackgroundImage"
|
||||
PropertyChanges {
|
||||
target: imgCover
|
||||
opacity: 0
|
||||
}
|
||||
},
|
||||
State {
|
||||
name: "outExit"
|
||||
name: "exit"
|
||||
PropertyChanges {
|
||||
target: imgCover
|
||||
opacity: 1
|
||||
@ -175,18 +174,24 @@ Rectangle {
|
||||
]
|
||||
transitions: [
|
||||
Transition {
|
||||
from: "out"
|
||||
to: "in"
|
||||
from: "showDefaultBackgroundImage"
|
||||
to: "hideDefaultBackgroundImage"
|
||||
reversible: true
|
||||
PropertyAnimation {
|
||||
target: imgCover
|
||||
duration: 600
|
||||
property: "opacity"
|
||||
|
||||
SequentialAnimation {
|
||||
PauseAnimation {
|
||||
duration: 100
|
||||
}
|
||||
PropertyAnimation {
|
||||
target: imgCover
|
||||
duration: 600
|
||||
property: "opacity"
|
||||
}
|
||||
}
|
||||
},
|
||||
Transition {
|
||||
from: "out"
|
||||
to: "outExit"
|
||||
from: "hideDefaultBackgroundImage"
|
||||
to: "exit"
|
||||
reversible: true
|
||||
SequentialAnimation {
|
||||
PropertyAnimation {
|
||||
@ -279,6 +284,23 @@ Rectangle {
|
||||
text: "sdk.appID " + Wallpaper.sdk.appID
|
||||
font.pointSize: 14
|
||||
}
|
||||
Text {
|
||||
text: "canFadeByWallpaperFillMode " + canFadeByWallpaperFillMode
|
||||
font.pointSize: 14
|
||||
}
|
||||
Text {
|
||||
text: "Wallpaper.canFade " + Wallpaper.canFade
|
||||
font.pointSize: 14
|
||||
}
|
||||
Text {
|
||||
text: "imgCover.source " + Qt.resolvedUrl(
|
||||
"file:///" + Wallpaper.windowsDesktopProperties.wallpaperPath)
|
||||
font.pointSize: 14
|
||||
}
|
||||
Text {
|
||||
text: "imgCover.status " + imgCover.status
|
||||
font.pointSize: 14
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user