mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-10-16 16:24:00 -04:00
@@ -3,6 +3,7 @@ import Quickshell
|
||||
|
||||
QtObject {
|
||||
required property Singleton service
|
||||
property var modules: null
|
||||
property bool active: true
|
||||
|
||||
property bool _held: false
|
||||
@@ -11,7 +12,15 @@ QtObject {
|
||||
if (wanted === _held)
|
||||
return;
|
||||
_held = wanted;
|
||||
service.refCount += wanted ? 1 : -1;
|
||||
if (modules === null) {
|
||||
service.refCount += wanted ? 1 : -1;
|
||||
return;
|
||||
}
|
||||
if (wanted) {
|
||||
service.addRef(modules);
|
||||
return;
|
||||
}
|
||||
service.removeRef(modules);
|
||||
}
|
||||
|
||||
onActiveChanged: sync(active)
|
||||
|
||||
@@ -19,8 +19,11 @@ Rectangle {
|
||||
signal settingsButtonClicked
|
||||
signal headerTapped
|
||||
|
||||
Component.onCompleted: DgopService.addRef("system")
|
||||
Component.onDestruction: DgopService.removeRef("system")
|
||||
Ref {
|
||||
service: DgopService
|
||||
modules: "system"
|
||||
active: root.visible && (root.Window.window?.visible ?? false)
|
||||
}
|
||||
|
||||
implicitHeight: 70
|
||||
radius: Theme.cornerRadius
|
||||
|
||||
@@ -20,12 +20,10 @@ Rectangle {
|
||||
border.color: Theme.outlineMedium
|
||||
border.width: Theme.layerOutlineWidth
|
||||
|
||||
Component.onCompleted: {
|
||||
DgopService.addRef(["diskmounts"]);
|
||||
}
|
||||
|
||||
Component.onDestruction: {
|
||||
DgopService.removeRef(["diskmounts"]);
|
||||
Ref {
|
||||
service: DgopService
|
||||
modules: ["diskmounts"]
|
||||
active: root.visible && (root.Window.window?.visible ?? false)
|
||||
}
|
||||
|
||||
DankFlickable {
|
||||
|
||||
@@ -67,11 +67,10 @@ CompoundPill {
|
||||
return Theme.surfaceText;
|
||||
}
|
||||
|
||||
Component.onCompleted: {
|
||||
DgopService.addRef(["diskmounts"]);
|
||||
}
|
||||
Component.onDestruction: {
|
||||
DgopService.removeRef(["diskmounts"]);
|
||||
Ref {
|
||||
service: DgopService
|
||||
modules: ["diskmounts"]
|
||||
active: root.visible && (root.Window.window?.visible ?? false)
|
||||
}
|
||||
|
||||
onToggled: {
|
||||
|
||||
@@ -117,10 +117,9 @@ Rectangle {
|
||||
onClicked: root.clicked()
|
||||
}
|
||||
|
||||
Component.onCompleted: {
|
||||
DgopService.addRef(["diskmounts"]);
|
||||
}
|
||||
Component.onDestruction: {
|
||||
DgopService.removeRef(["diskmounts"]);
|
||||
Ref {
|
||||
service: DgopService
|
||||
modules: ["diskmounts"]
|
||||
active: root.visible && (root.Window.window?.visible ?? false)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user