1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-06-15 07:35: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 b60af507d7
commit fdee09b583
3 changed files with 10 additions and 2 deletions
@@ -235,7 +235,7 @@ Conditionally show/hide the bar pill:
```qml ```qml
PluginComponent { PluginComponent {
visibilityCommand: "pgrep -x myapp" 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 centerWidgetsModel
property var rightWidgetsModel property var rightWidgetsModel
readonly property bool barRevealed: inputMask.showing
property var controlCenterButtonRef: null property var controlCenterButtonRef: null
property var clockButtonRef: null property var clockButtonRef: null
property var systemUpdateButtonRef: null property var systemUpdateButtonRef: null
@@ -23,6 +23,7 @@ Item {
property bool conditionVisible: true property bool conditionVisible: true
property bool _visibilityOverride: false property bool _visibilityOverride: false
property bool _visibilityOverrideValue: true property bool _visibilityOverrideValue: true
readonly property bool _barRevealed: blurBarWindow?.barRevealed ?? true
readonly property bool effectiveVisible: { readonly property bool effectiveVisible: {
if (_visibilityOverride) if (_visibilityOverride)
@@ -122,6 +123,11 @@ Item {
conditionVisible = true; conditionVisible = true;
} }
on_BarRevealedChanged: {
if (_barRevealed && visibilityCommand && !_visibilityOverride)
checkVisibility();
}
onVisibilityIntervalChanged: { onVisibilityIntervalChanged: {
if (visibilityInterval > 0 && visibilityCommand) { if (visibilityInterval > 0 && visibilityCommand) {
visibilityTimer.restart(); visibilityTimer.restart();
@@ -134,7 +140,7 @@ Item {
id: visibilityTimer id: visibilityTimer
interval: root.visibilityInterval * 1000 interval: root.visibilityInterval * 1000
repeat: true repeat: true
running: root.visibilityInterval > 0 && root.visibilityCommand !== "" running: root.visibilityInterval > 0 && root.visibilityCommand !== "" && root._barRevealed && !root._visibilityOverride
onTriggered: root.checkVisibility() onTriggered: root.checkVisibility()
} }