1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-08-07 05:58:28 -04:00

fix(Hover): refactor & update hover tracking w/context menus

Fixes #2737
This commit is contained in:
purian23
2026-07-04 00:08:58 -04:00
parent 2861cc89c6
commit c554d973ef
30 changed files with 297 additions and 27 deletions
+13
View File
@@ -54,11 +54,14 @@ Item {
property bool addHorizontalPadding: false
property string emptyText: ""
property bool usePopupTransparency: !checkParentDisablesTransparency()
property var transientSurfaceTracker: null
signal valueChanged(string value)
property bool menuOpen: false
onMenuOpenChanged: transientSurfaceTracker?.setActive(root, menuOpen, null)
function closeDropdownMenu() {
if (!root.menuOpen && !dropdownMenu.opened && !dropdownMenu.visible)
return;
@@ -113,10 +116,20 @@ Item {
implicitHeight: !showTrigger ? 0 : (compactMode ? 40 : Math.max(60, labelColumn.implicitHeight + Theme.spacingM))
Component.onDestruction: {
transientSurfaceTracker?.unregister(root);
if (root.menuOpen || dropdownMenu.opened || dropdownMenu.visible)
dropdownMenu.close();
}
Connections {
target: root.transientSurfaceTracker
ignoreUnknownSignals: true
function onCloseRequested() {
root.closeDropdownMenu();
}
}
Column {
id: labelColumn