Background: add default wallpaper
This commit is contained in:
parent
b6166a2a7c
commit
c0900b105b
4 changed files with 20 additions and 1 deletions
BIN
Assets/Wallpaper/noctalia.png
Normal file
BIN
Assets/Wallpaper/noctalia.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 87 KiB |
|
|
@ -26,6 +26,7 @@ Singleton {
|
||||||
property string defaultWallpapersDirectory: Quickshell.env("HOME") + "/Pictures/Wallpapers"
|
property string defaultWallpapersDirectory: Quickshell.env("HOME") + "/Pictures/Wallpapers"
|
||||||
property string defaultVideosDirectory: Quickshell.env("HOME") + "/Videos"
|
property string defaultVideosDirectory: Quickshell.env("HOME") + "/Videos"
|
||||||
property string defaultLocation: "Tokyo"
|
property string defaultLocation: "Tokyo"
|
||||||
|
property string defaultWallpaper: Quickshell.shellDir + "/Assets/Wallpaper/noctalia.png"
|
||||||
|
|
||||||
// Used to access via Settings.data.xxx.yyy
|
// Used to access via Settings.data.xxx.yyy
|
||||||
readonly property alias data: adapter
|
readonly property alias data: adapter
|
||||||
|
|
@ -334,6 +335,7 @@ Singleton {
|
||||||
property int transitionDuration: 1500 // 1500 ms
|
property int transitionDuration: 1500 // 1500 ms
|
||||||
property string transitionType: "random"
|
property string transitionType: "random"
|
||||||
property real transitionEdgeSmoothness: 0.05
|
property real transitionEdgeSmoothness: 0.05
|
||||||
|
property string defaultWallpaper: root.defaultWallpaper
|
||||||
property list<var> monitors: []
|
property list<var> monitors: []
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,8 @@ import Quickshell
|
||||||
import Quickshell.Wayland
|
import Quickshell.Wayland
|
||||||
import qs.Commons
|
import qs.Commons
|
||||||
import qs.Services
|
import qs.Services
|
||||||
|
import qs.Modules.SettingsPanel
|
||||||
|
import qs.Widgets
|
||||||
|
|
||||||
Variants {
|
Variants {
|
||||||
id: backgroundVariants
|
id: backgroundVariants
|
||||||
|
|
@ -20,6 +22,8 @@ Variants {
|
||||||
// Internal state management
|
// Internal state management
|
||||||
property string transitionType: "fade"
|
property string transitionType: "fade"
|
||||||
property real transitionProgress: 0
|
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 real edgeSmoothness: Settings.data.wallpaper.transitionEdgeSmoothness
|
||||||
readonly property var allTransitions: WallpaperService.allTransitions
|
readonly property var allTransitions: WallpaperService.allTransitions
|
||||||
|
|
@ -87,6 +91,15 @@ Variants {
|
||||||
left: true
|
left: true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Connections {
|
||||||
|
target: ScalingService
|
||||||
|
function onScaleChanged(screenName, scale) {
|
||||||
|
if ((screen !== null) && (screenName === screen.name)) {
|
||||||
|
scaling = scale
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Timer {
|
Timer {
|
||||||
id: debounceTimer
|
id: debounceTimer
|
||||||
interval: 333
|
interval: 333
|
||||||
|
|
|
||||||
|
|
@ -216,7 +216,11 @@ Singleton {
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
// Get specific monitor wallpaper - now from cache
|
// Get specific monitor wallpaper - now from cache
|
||||||
function getWallpaper(screenName) {
|
function getWallpaper(screenName) {
|
||||||
return currentWallpapers[screenName] || ""
|
var path = currentWallpapers[screenName] || ""
|
||||||
|
if (path === "") {
|
||||||
|
return Settings.data.wallpaper.defaultWallpaper || ""
|
||||||
|
}
|
||||||
|
return path
|
||||||
}
|
}
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue