From 2f9eb28596956d61b4f36ed588e139949d363d9e Mon Sep 17 00:00:00 2001 From: LemmyCook Date: Fri, 29 Aug 2025 16:53:43 -0400 Subject: [PATCH] Wallpaper: On startup set wallpaper without transition --- Modules/Background/Background.qml | 33 +++++++++++++++---- .../Tabs/WallpaperSelectorTab.qml | 2 +- Modules/SettingsPanel/Tabs/WallpaperTab.qml | 2 +- 3 files changed, 28 insertions(+), 9 deletions(-) diff --git a/Modules/Background/Background.qml b/Modules/Background/Background.qml index b896099..1911f34 100644 --- a/Modules/Background/Background.qml +++ b/Modules/Background/Background.qml @@ -17,13 +17,24 @@ Variants { sourceComponent: PanelWindow { id: root - readonly property real transitionDuration: Settings.data.wallpaper.transitionDuration - readonly property real transitionType: Settings.data.wallpaper.transitionType + // Internal state management + property bool transitioning: false + property real fadeValue: 0.0 + property bool firstWallpaper: true + // External state management property string servicedWallpaper: WallpaperService.getWallpaper(modelData.name) onServicedWallpaperChanged: { if (servicedWallpaper && servicedWallpaper !== currentWallpaper.source) { - if (Settings.data.wallpaper.transitionType == 'fade') { + + // Set wallpaper immediately on startup + if (firstWallpaper) { + firstWallpaper = false + setWallpaperImmediate(servicedWallpaper) + return + } + + if (Settings.data.wallpaper.transitionType === 'fade') { setWallpaperWithTransition(servicedWallpaper) } else { setWallpaperImmediate(servicedWallpaper) @@ -31,10 +42,6 @@ Variants { } } - // Internal state management - property bool transitioning: false - property real fadeValue: 0.0 - color: Color.transparent screen: modelData WlrLayershell.layer: WlrLayer.Background @@ -114,6 +121,18 @@ Variants { function setWallpaperWithTransition(source) { if (source != currentWallpaper.source) { + + if (transitioning) { + // we are interupting a transition + if (fadeValue >= 0.5) { + + } + currentWallpaper.source = nextWallpaper.source + fadeAnimation.stop() + fadeValue = 0 + transitioning = false + } + nextWallpaper.source = source startTransition() } diff --git a/Modules/SettingsPanel/Tabs/WallpaperSelectorTab.qml b/Modules/SettingsPanel/Tabs/WallpaperSelectorTab.qml index 6731916..b708f9d 100644 --- a/Modules/SettingsPanel/Tabs/WallpaperSelectorTab.qml +++ b/Modules/SettingsPanel/Tabs/WallpaperSelectorTab.qml @@ -98,7 +98,7 @@ ColumnLayout { model: wallpapersList boundsBehavior: Flickable.StopAtBounds - flickableDirection: Flickable.AutoFlickDirection + flickableDirection: Flickable.VerticalFlick interactive: false property int columns: 5 diff --git a/Modules/SettingsPanel/Tabs/WallpaperTab.qml b/Modules/SettingsPanel/Tabs/WallpaperTab.qml index 9143f7c..546a4ca 100644 --- a/Modules/SettingsPanel/Tabs/WallpaperTab.qml +++ b/Modules/SettingsPanel/Tabs/WallpaperTab.qml @@ -114,7 +114,7 @@ ColumnLayout { NSlider { Layout.fillWidth: true from: 100 - to: 10000 + to: 5000 stepSize: 100 value: Settings.data.wallpaper.transitionDuration onMoved: Settings.data.wallpaper.transitionDuration = value