From 7a324e61192cc978ef1747a840d847b7e1b13cb5 Mon Sep 17 00:00:00 2001 From: voidarc Date: Tue, 30 Jun 2026 12:03:18 +0100 Subject: [PATCH] fixed forceHide logic so that the bluetooth menu works --- Bar/Right/Bluetooth.qml | 17 +++++++---------- Components/Container.qml | 19 +++++++++++-------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/Bar/Right/Bluetooth.qml b/Bar/Right/Bluetooth.qml index d43e111..a3df4db 100644 --- a/Bar/Right/Bluetooth.qml +++ b/Bar/Right/Bluetooth.qml @@ -10,7 +10,7 @@ import "Bluetooth" Container { id: root - property bool hidden: true + property bool shown: false animOffset: 200 boxColor: Colors.peach @@ -18,7 +18,7 @@ Container { boxWidth: 30 defaultItem: icon exclusiveToScreen: true - forceHidden: (hidden == true || BluetoothManager.getConnected()) + forceHidden: !(root.shown || BluetoothManager.getConnected()) hoverableWhenHidden: true state: "" @@ -34,9 +34,6 @@ Container { StateChangeScript { script: { root.stack.replace(icon); - if (BluetoothManager.getConnected() == false) { - root.hidden = false; - } } } }, @@ -52,7 +49,7 @@ Container { StateChangeScript { script: { root.stack.replace(expanded); - root.hidden = false; + root.shown = true; } } } @@ -63,7 +60,7 @@ Container { root.state = ""; hoverIntervalTimer.start(); } else { - root.hidden = false; + root.shown = true; hoverIntervalTimer.start(); } } @@ -72,13 +69,13 @@ Container { Timer { id: hoverIntervalTimer - interval: 1000 + interval: 500 repeat: false running: false onTriggered: { - if (root.hover.hovered != true && root.state != "expanded") { - root.hidden = true; + if (root.hover.hovered == false) { + root.shown = false; } } } diff --git a/Components/Container.qml b/Components/Container.qml index 91980db..dfde525 100644 --- a/Components/Container.qml +++ b/Components/Container.qml @@ -15,16 +15,19 @@ Item { property double boxRadius: 9 property double boxWidth: 100 readonly property double calculatedTopMargin: { - if (root.exclusiveToScreen) { - let baseMargin = hoverableWhenHidden == true ? 8 : -4; - if (Hyprland.focusedMonitor != root.exclusiveMonitor || forceHidden == true) { - return baseMargin - root.boxHeight - 5; - } else { - return visibleTopMargin; - } - } else { + if (!root.exclusiveToScreen) { return visibleTopMargin; } + + if (Hyprland.focusedMonitor == root.exclusiveMonitor) { + if (!root.forceHidden) { + return visibleTopMargin; + } else if (root.hoverableWhenHidden) { + return 7 - root.boxHeight - 5; + } + } + + return -4 - root.boxHeight - 5; } property Component defaultItem required property HyprlandMonitor exclusiveMonitor