WallpaperService: refactored to a simpler signal based approach.
This commit is contained in:
parent
4193d3c87c
commit
5fef9cfe6b
8 changed files with 217 additions and 76 deletions
|
|
@ -14,11 +14,24 @@ Variants {
|
|||
|
||||
active: Settings.isLoaded && CompositorService.isNiri && modelData
|
||||
|
||||
property string wallpaper: ""
|
||||
|
||||
sourceComponent: PanelWindow {
|
||||
Component.onCompleted: {
|
||||
if (modelData) {
|
||||
Logger.log("Overview", "Loading Overview component for Niri on", modelData.name)
|
||||
}
|
||||
wallpaper = modelData ? WallpaperService.getWallpaper(modelData.name) : ""
|
||||
}
|
||||
|
||||
// External state management
|
||||
Connections {
|
||||
target: WallpaperService
|
||||
function onWallpaperChanged(screenName, path) {
|
||||
if (screenName === modelData.name) {
|
||||
wallpaper = path
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
color: Color.transparent
|
||||
|
|
@ -38,7 +51,7 @@ Variants {
|
|||
id: bgImage
|
||||
anchors.fill: parent
|
||||
fillMode: Image.PreserveAspectCrop
|
||||
source: modelData ? WallpaperService.getWallpaper(modelData.name) : ""
|
||||
source: wallpaper
|
||||
smooth: true
|
||||
mipmap: false
|
||||
cache: false
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue