1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-06-15 15:45:20 -04:00

refactor: enhance plugin visibility w/bar reveal state

This commit is contained in:
purian23
2026-06-10 20:02:48 -04:00
parent 9d046847fa
commit cc8d68d753
3 changed files with 10 additions and 2 deletions
@@ -235,7 +235,7 @@ Conditionally show/hide the bar pill:
```qml
PluginComponent {
visibilityCommand: "pgrep -x myapp"
visibilityInterval: 5000 // check every 5 seconds
visibilityInterval: 5 // seconds between checks; polling pauses while the bar is hidden
}
```
@@ -20,6 +20,8 @@ PanelWindow {
property var centerWidgetsModel
property var rightWidgetsModel
readonly property bool barRevealed: inputMask.showing
property var controlCenterButtonRef: null
property var clockButtonRef: null
property var systemUpdateButtonRef: null
@@ -23,6 +23,7 @@ Item {
property bool conditionVisible: true
property bool _visibilityOverride: false
property bool _visibilityOverrideValue: true
readonly property bool _barRevealed: blurBarWindow?.barRevealed ?? true
readonly property bool effectiveVisible: {
if (_visibilityOverride)
@@ -122,6 +123,11 @@ Item {
conditionVisible = true;
}
on_BarRevealedChanged: {
if (_barRevealed && visibilityCommand && !_visibilityOverride)
checkVisibility();
}
onVisibilityIntervalChanged: {
if (visibilityInterval > 0 && visibilityCommand) {
visibilityTimer.restart();
@@ -134,7 +140,7 @@ Item {
id: visibilityTimer
interval: root.visibilityInterval * 1000
repeat: true
running: root.visibilityInterval > 0 && root.visibilityCommand !== ""
running: root.visibilityInterval > 0 && root.visibilityCommand !== "" && root._barRevealed && !root._visibilityOverride
onTriggered: root.checkVisibility()
}