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
@@ -0,0 +1,37 @@
pragma ComponentBehavior: Bound
import QtQuick
QtObject {
id: root
property var _entries: []
readonly property bool active: _entries.length > 0
readonly property var focusWindows: _entries.map(entry => entry.focusWindow).filter(window => window)
signal closeRequested
function setActive(owner, active, focusWindow) {
if (!owner)
return;
const next = _entries.filter(entry => entry.owner !== owner);
if (active) {
next.push({
"owner": owner,
"focusWindow": focusWindow ?? null
});
}
_entries = next;
}
function unregister(owner) {
setActive(owner, false, null);
}
function closeAll() {
if (_entries.length === 0)
return;
closeRequested();
_entries = [];
}
}