Wallpaper rework

- removed swww to the code is easier to maintain
- basic multi monitor wallpaper support
This commit is contained in:
LemmyCook 2025-08-29 08:33:40 -04:00
parent 3cc8c8fb03
commit e79c163dd9
12 changed files with 330 additions and 552 deletions

View file

@ -29,7 +29,7 @@ ColumnLayout {
id: currentWallpaperImage
anchors.fill: parent
anchors.margins: Style.marginXS * scaling
imagePath: WallpaperService.currentWallpaper
imagePath: WallpaperService.getWallpaper(screen.name)
fallbackIcon: "image"
imageRadius: Style.radiusM * scaling
}
@ -62,14 +62,6 @@ ColumnLayout {
wrapMode: Text.WordWrap
Layout.fillWidth: true
}
NText {
text: Settings.data.wallpaper.swww.enabled ? "Wallpapers will change with " + Settings.data.wallpaper.swww.transitionType
+ " transition." : "Wallpapers will change instantly."
color: Color.mOnSurface
font.pointSize: Style.fontSizeXS * scaling
visible: Settings.data.wallpaper.swww.enabled
}
}
NIconButton {
@ -78,10 +70,17 @@ ColumnLayout {
onClicked: {
WallpaperService.listWallpapers()
}
Layout.alignment: Qt.AlignTop | Qt.AlignRight
Layout.alignment: Qt.AlignVCenter | Qt.AlignRight
}
}
NToggle {
label: "Assign selection to all monitors"
description: "Set selected wallpaper on all monitors at once."
checked: Settings.data.wallpaper.setWallpaperOnAllMonitors
onToggled: checked => Settings.data.wallpaper.setWallpaperOnAllMonitors = checked
}
// Wallpaper grid container
Item {
Layout.fillWidth: true
@ -179,7 +178,11 @@ ColumnLayout {
acceptedButtons: Qt.LeftButton
hoverEnabled: true
onClicked: {
WallpaperService.changeWallpaper(wallpaperPath)
if (Settings.data.wallpaper.setWallpaperOnAllMonitors) {
WallpaperService.changeWallpaper(undefined, wallpaperPath)
} else {
WallpaperService.changeWallpaper(screen.name, wallpaperPath)
}
}
}
}