diff --git a/Assets/Wallpaper/noctalia.png b/Assets/Wallpaper/noctalia.png new file mode 100644 index 0000000..a9b41a2 Binary files /dev/null and b/Assets/Wallpaper/noctalia.png differ diff --git a/Commons/Settings.qml b/Commons/Settings.qml index da0da40..3072636 100644 --- a/Commons/Settings.qml +++ b/Commons/Settings.qml @@ -26,6 +26,7 @@ Singleton { property string defaultWallpapersDirectory: Quickshell.env("HOME") + "/Pictures/Wallpapers" property string defaultVideosDirectory: Quickshell.env("HOME") + "/Videos" property string defaultLocation: "Tokyo" + property string defaultWallpaper: Quickshell.shellDir + "/Assets/Wallpaper/noctalia.png" // Used to access via Settings.data.xxx.yyy readonly property alias data: adapter @@ -334,6 +335,7 @@ Singleton { property int transitionDuration: 1500 // 1500 ms property string transitionType: "random" property real transitionEdgeSmoothness: 0.05 + property string defaultWallpaper: root.defaultWallpaper property list monitors: [] } diff --git a/Modules/Background/Background.qml b/Modules/Background/Background.qml index a1eca8b..3730838 100644 --- a/Modules/Background/Background.qml +++ b/Modules/Background/Background.qml @@ -3,6 +3,8 @@ import Quickshell import Quickshell.Wayland import qs.Commons import qs.Services +import qs.Modules.SettingsPanel +import qs.Widgets Variants { id: backgroundVariants @@ -20,6 +22,8 @@ Variants { // Internal state management property string transitionType: "fade" property real transitionProgress: 0 + // Scaling support for widgets that rely on it + property real scaling: ScalingService.getScreenScale(screen) readonly property real edgeSmoothness: Settings.data.wallpaper.transitionEdgeSmoothness readonly property var allTransitions: WallpaperService.allTransitions @@ -87,6 +91,15 @@ Variants { left: true } + Connections { + target: ScalingService + function onScaleChanged(screenName, scale) { + if ((screen !== null) && (screenName === screen.name)) { + scaling = scale + } + } + } + Timer { id: debounceTimer interval: 333 diff --git a/Services/WallpaperService.qml b/Services/WallpaperService.qml index 7f99a0d..311bdae 100644 --- a/Services/WallpaperService.qml +++ b/Services/WallpaperService.qml @@ -216,7 +216,11 @@ Singleton { // ------------------------------------------------------------------- // Get specific monitor wallpaper - now from cache function getWallpaper(screenName) { - return currentWallpapers[screenName] || "" + var path = currentWallpapers[screenName] || "" + if (path === "") { + return Settings.data.wallpaper.defaultWallpaper || "" + } + return path } // -------------------------------------------------------------------