mirror of
https://github.com/zoriya/noctalia-shell.git
synced 2025-12-06 06:36:15 +00:00
Wallpaper: On startup set wallpaper without transition
This commit is contained in:
@@ -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()
|
||||
}
|
||||
|
||||
@@ -98,7 +98,7 @@ ColumnLayout {
|
||||
model: wallpapersList
|
||||
|
||||
boundsBehavior: Flickable.StopAtBounds
|
||||
flickableDirection: Flickable.AutoFlickDirection
|
||||
flickableDirection: Flickable.VerticalFlick
|
||||
interactive: false
|
||||
|
||||
property int columns: 5
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user