diff options
| author | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-07-23 17:21:05 +1000 |
|---|---|---|
| committer | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-07-23 17:21:05 +1000 |
| commit | e104428b2893ca9f0cf4557f300f67bb70f13081 (patch) | |
| tree | 183291d5f3a99f4fa3ace98b521e3ea53162de68 /modules/bar/popouts | |
| parent | popouts: better bluetooth popout (diff) | |
| download | caelestia-shell-e104428b2893ca9f0cf4557f300f67bb70f13081.tar.gz caelestia-shell-e104428b2893ca9f0cf4557f300f67bb70f13081.tar.bz2 caelestia-shell-e104428b2893ca9f0cf4557f300f67bb70f13081.zip | |
popouts: better tray menu focus handling
Don't hide on hover lost, use a focus grab instead
Diffstat (limited to 'modules/bar/popouts')
| -rw-r--r-- | modules/bar/popouts/Content.qml | 13 | ||||
| -rw-r--r-- | modules/bar/popouts/TrayMenu.qml | 7 | ||||
| -rw-r--r-- | modules/bar/popouts/Wrapper.qml | 4 |
3 files changed, 11 insertions, 13 deletions
diff --git a/modules/bar/popouts/Content.qml b/modules/bar/popouts/Content.qml index 0e0f5f3..684f702 100644 --- a/modules/bar/popouts/Content.qml +++ b/modules/bar/popouts/Content.qml @@ -1,6 +1,5 @@ pragma ComponentBehavior: Bound -import qs.services import qs.config import Quickshell import Quickshell.Services.SystemTray @@ -10,10 +9,6 @@ Item { id: root required property Item wrapper - required property ShellScreen screen - required property string currentName - required property real currentCenter - required property bool hasCurrent anchors.centerIn: parent @@ -63,10 +58,10 @@ Item { sourceComponent: trayMenuComp Connections { - target: root + target: root.wrapper function onHasCurrentChanged(): void { - if (root.hasCurrent && trayMenu.shouldBeActive) { + if (root.wrapper.hasCurrent && trayMenu.shouldBeActive) { trayMenu.sourceComponent = null; trayMenu.sourceComponent = trayMenuComp; } @@ -77,7 +72,7 @@ Item { id: trayMenuComp TrayMenu { - popouts: root + popouts: root.wrapper trayItem: trayMenu.modelData.menu } } @@ -89,7 +84,7 @@ Item { id: popout required property string name - property bool shouldBeActive: root.currentName === name + property bool shouldBeActive: root.wrapper.currentName === name anchors.verticalCenter: parent.verticalCenter anchors.right: parent.right diff --git a/modules/bar/popouts/TrayMenu.qml b/modules/bar/popouts/TrayMenu.qml index 07742db..59f310b 100644 --- a/modules/bar/popouts/TrayMenu.qml +++ b/modules/bar/popouts/TrayMenu.qml @@ -5,6 +5,7 @@ import qs.services import qs.config import Quickshell import Quickshell.Widgets +import Quickshell.Hyprland import QtQuick import QtQuick.Controls @@ -26,6 +27,12 @@ StackView { popEnter: Anim {} popExit: Anim {} + HyprlandFocusGrab { + active: true + windows: [QsWindow.window] + onCleared: root.popouts.hasCurrent = false + } + component Anim: Transition { NumberAnimation { duration: 0 diff --git a/modules/bar/popouts/Wrapper.qml b/modules/bar/popouts/Wrapper.qml index 8525c7a..293f9d5 100644 --- a/modules/bar/popouts/Wrapper.qml +++ b/modules/bar/popouts/Wrapper.qml @@ -72,10 +72,6 @@ Item { sourceComponent: Content { wrapper: root - screen: root.screen - currentName: root.currentName - currentCenter: root.currentCenter - hasCurrent: root.hasCurrent } } |