mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-01-27 23:12:49 -05:00
Add support for linux-wallpaperengine wallpapers (#191)
* Add support for linux-wallpaperengine wallpapers * Remove unnecessary onCompleted hook
This commit is contained in:
@@ -2,8 +2,10 @@ import QtQuick
|
||||
import Quickshell
|
||||
import Quickshell.Wayland
|
||||
import Quickshell.Widgets
|
||||
import Quickshell.Io
|
||||
import qs.Common
|
||||
import qs.Widgets
|
||||
import qs.Modules
|
||||
|
||||
LazyLoader {
|
||||
active: true
|
||||
@@ -36,20 +38,38 @@ LazyLoader {
|
||||
property bool isColorSource: source.startsWith("#")
|
||||
property Image current: one
|
||||
|
||||
WallpaperEngineProc {
|
||||
id: weProc
|
||||
monitor: modelData.name
|
||||
}
|
||||
|
||||
Component.onDestruction: {
|
||||
weProc.stop()
|
||||
}
|
||||
|
||||
onSourceChanged: {
|
||||
if (!source) {
|
||||
current = null
|
||||
one.source = ""
|
||||
two.source = ""
|
||||
} else if (isColorSource) {
|
||||
const isWE = source.startsWith("we:")
|
||||
if (isWE) {
|
||||
current = null
|
||||
one.source = ""
|
||||
two.source = ""
|
||||
weProc.start(source.substring(3)) // strip "we:"
|
||||
} else {
|
||||
if (current === one)
|
||||
two.update()
|
||||
else
|
||||
one.update()
|
||||
weProc.stop()
|
||||
if (!source) {
|
||||
current = null
|
||||
one.source = ""
|
||||
two.source = ""
|
||||
} else if (isColorSource) {
|
||||
current = null
|
||||
one.source = ""
|
||||
two.source = ""
|
||||
} else {
|
||||
if (current === one)
|
||||
two.update()
|
||||
else
|
||||
one.update()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user