From a57dd9343a2643f73f3994dc230b824617f89ecf Mon Sep 17 00:00:00 2001 From: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> Date: Sat, 13 Sep 2025 11:25:11 +1000 Subject: popouts/tray: better interaction Not exclusive when on first layer of submenus Closes #610 --- modules/bar/popouts/Content.qml | 6 ++++-- modules/bar/popouts/TrayMenu.qml | 2 +- modules/bar/popouts/Wrapper.qml | 1 + modules/drawers/Interactions.qml | 2 +- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/modules/bar/popouts/Content.qml b/modules/bar/popouts/Content.qml index b600867..5c9fdf7 100644 --- a/modules/bar/popouts/Content.qml +++ b/modules/bar/popouts/Content.qml @@ -10,11 +10,13 @@ Item { id: root required property Item wrapper + readonly property Popout currentPopout: content.children.find(c => c.shouldBeActive) ?? null + readonly property Item current: currentPopout?.item ?? null anchors.centerIn: parent - implicitWidth: (content.children.find(c => c.shouldBeActive)?.implicitWidth ?? 0) + Appearance.padding.large * 2 - implicitHeight: (content.children.find(c => c.shouldBeActive)?.implicitHeight ?? 0) + Appearance.padding.large * 2 + implicitWidth: (currentPopout?.implicitWidth ?? 0) + Appearance.padding.large * 2 + implicitHeight: (currentPopout?.implicitHeight ?? 0) + Appearance.padding.large * 2 Item { id: content diff --git a/modules/bar/popouts/TrayMenu.qml b/modules/bar/popouts/TrayMenu.qml index 986c806..02c76d2 100644 --- a/modules/bar/popouts/TrayMenu.qml +++ b/modules/bar/popouts/TrayMenu.qml @@ -28,7 +28,7 @@ StackView { popExit: NoAnim {} HyprlandFocusGrab { - active: true + active: root.depth > 1 windows: [QsWindow.window] onCleared: root.popouts.hasCurrent = false } diff --git a/modules/bar/popouts/Wrapper.qml b/modules/bar/popouts/Wrapper.qml index 20f4c5b..4be47e4 100644 --- a/modules/bar/popouts/Wrapper.qml +++ b/modules/bar/popouts/Wrapper.qml @@ -17,6 +17,7 @@ Item { readonly property real nonAnimWidth: x > 0 || hasCurrent ? children.find(c => c.shouldBeActive)?.implicitWidth ?? content.implicitWidth : 0 readonly property real nonAnimHeight: children.find(c => c.shouldBeActive)?.implicitHeight ?? content.implicitHeight + readonly property Item current: content.item?.current ?? null property string currentName property real currentCenter diff --git a/modules/drawers/Interactions.qml b/modules/drawers/Interactions.qml index 484b28e..2783f37 100644 --- a/modules/drawers/Interactions.qml +++ b/modules/drawers/Interactions.qml @@ -73,7 +73,7 @@ CustomMouseArea { if (!utilitiesShortcutActive) visibilities.utilities = false; - if (!popouts.currentName.startsWith("traymenu")) + if (!popouts.currentName.startsWith("traymenu") || popouts.current.depth <= 1) popouts.hasCurrent = false; if (Config.bar.showOnHover) -- cgit v1.2.3-freya