Wallpaper: minor improvements
This commit is contained in:
parent
65f73bb1ba
commit
3ba6899e69
2 changed files with 20 additions and 22 deletions
|
|
@ -104,8 +104,7 @@ Variants {
|
|||
mipmap: false
|
||||
visible: false
|
||||
cache: false
|
||||
// currentWallpaper should not be asynchronous to avoid flickering when swapping next to current.
|
||||
asynchronous: false
|
||||
asynchronous: true
|
||||
}
|
||||
|
||||
Image {
|
||||
|
|
@ -236,12 +235,9 @@ Variants {
|
|||
currentWallpaper.source = nextWallpaper.source
|
||||
nextWallpaper.source = ""
|
||||
transitionProgress = 0.0
|
||||
}
|
||||
}
|
||||
|
||||
function startTransition() {
|
||||
if (!transitioning && nextWallpaper.source != currentWallpaper.source) {
|
||||
transitionAnimation.start()
|
||||
Qt.callLater(() => {
|
||||
currentWallpaper.asynchronous = true
|
||||
}, 100)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -253,19 +249,21 @@ Variants {
|
|||
}
|
||||
|
||||
function setWallpaperWithTransition(source) {
|
||||
if (source != currentWallpaper.source) {
|
||||
|
||||
if (transitioning) {
|
||||
// We are interrupting a transition
|
||||
transitionAnimation.stop()
|
||||
transitionProgress = 0
|
||||
currentWallpaper.source = nextWallpaper.source
|
||||
nextWallpaper.source = ""
|
||||
}
|
||||
|
||||
nextWallpaper.source = source
|
||||
startTransition()
|
||||
if (source === currentWallpaper.source) {
|
||||
return
|
||||
}
|
||||
|
||||
if (transitioning) {
|
||||
// We are interrupting a transition
|
||||
transitionAnimation.stop()
|
||||
transitionProgress = 0
|
||||
currentWallpaper.source = nextWallpaper.source
|
||||
nextWallpaper.source = ""
|
||||
}
|
||||
|
||||
nextWallpaper.source = source
|
||||
currentWallpaper.asynchronous = false
|
||||
transitionAnimation.start()
|
||||
}
|
||||
|
||||
// Main method that actually trigger the wallpaper change
|
||||
|
|
|
|||
|
|
@ -139,8 +139,8 @@ ColumnLayout {
|
|||
spacing: Style.marginL * scaling
|
||||
NSlider {
|
||||
Layout.fillWidth: true
|
||||
from: 100
|
||||
to: 5000
|
||||
from: 500
|
||||
to: 10000
|
||||
stepSize: 100
|
||||
value: Settings.data.wallpaper.transitionDuration
|
||||
onMoved: Settings.data.wallpaper.transitionDuration = value
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue