Add WallpaperSelector, add some scrolling in SettingsWindow

This commit is contained in:
Ly-sec 2025-08-12 17:26:23 +02:00
parent eff47f504f
commit 8155ef20eb
14 changed files with 1451 additions and 674 deletions

View file

@ -50,7 +50,14 @@ Singleton {
Component.onCompleted: function () {
reload()
}
onLoaded: function () {}
onLoaded: function () {
Qt.callLater(function () {
if (adapter.wallpaper.current !== "") {
console.log("Settings: Initializing wallpaper to:", adapter.wallpaper.current)
Wallpapers.setCurrentWallpaper(adapter.wallpaper.current, true)
}
})
}
onLoadFailed: function (error) {
if (error.toString().includes("No such file") || error === 2)
// File doesn't exist, create it with default values
@ -113,7 +120,7 @@ Singleton {
wallpaper: JsonObject {
property string directory: "/usr/share/wallpapers"
property string current: defaultWallpaper
property string current: ""
property bool isRandom: false
property int randomInterval: 300
property bool generateTheme: false
@ -178,4 +185,11 @@ Singleton {
}
}
}
Connections {
target: adapter.wallpaper
function onIsRandomChanged() { Wallpapers.toggleRandomWallpaper() }
function onRandomIntervalChanged() { Wallpapers.restartRandomWallpaperTimer() }
function onDirectoryChanged() { Wallpapers.loadWallpapers() }
}
}