From 3ba6899e695730b2c0726da95298488d67cabe10 Mon Sep 17 00:00:00 2001 From: LemmyCook Date: Wed, 3 Sep 2025 17:51:02 -0400 Subject: [PATCH] Wallpaper: minor improvements --- Modules/Background/Background.qml | 38 ++++++++++----------- Modules/SettingsPanel/Tabs/WallpaperTab.qml | 4 +-- 2 files changed, 20 insertions(+), 22 deletions(-) diff --git a/Modules/Background/Background.qml b/Modules/Background/Background.qml index 9249b1f..8fed9bf 100644 --- a/Modules/Background/Background.qml +++ b/Modules/Background/Background.qml @@ -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 diff --git a/Modules/SettingsPanel/Tabs/WallpaperTab.qml b/Modules/SettingsPanel/Tabs/WallpaperTab.qml index 4ac5093..e2832dd 100644 --- a/Modules/SettingsPanel/Tabs/WallpaperTab.qml +++ b/Modules/SettingsPanel/Tabs/WallpaperTab.qml @@ -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