Wallpaper: On startup set wallpaper without transition

This commit is contained in:
LemmyCook
2025-08-29 16:53:43 -04:00
parent 63e90a5c17
commit 2f9eb28596
3 changed files with 28 additions and 9 deletions

View File

@@ -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()
}

View File

@@ -98,7 +98,7 @@ ColumnLayout {
model: wallpapersList
boundsBehavior: Flickable.StopAtBounds
flickableDirection: Flickable.AutoFlickDirection
flickableDirection: Flickable.VerticalFlick
interactive: false
property int columns: 5

View File

@@ -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