1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-06-28 14:05:21 -04:00

feat(popouts): hover & settings cleanup

This commit is contained in:
purian23
2026-06-27 01:59:45 -04:00
parent 7979fb2b0e
commit 601d4104a3
11 changed files with 200 additions and 73 deletions
+39 -4
View File
@@ -95,6 +95,14 @@ Item {
enableFrameInsetAnimation.schedule();
}
Connections {
target: topBarContent._hasBarWindow ? topBarContent.barWindow.axis : null
function onEdgeChanged() {
topBarContent.resetHoverForBarGeometryChange();
}
}
Behavior on anchors.leftMargin {
enabled: _animateFrameInsets && _usesFrameBarChrome
NumberAnimation {
@@ -401,6 +409,19 @@ Item {
property var _pendingHoverHit: null
property string _pendingHoverTrigger: ""
function resetHoverForBarGeometryChange() {
_cancelPendingHover();
_hoverCloseTimer.stop();
_pendingPopoutOpenSpec = null;
const activePopout = PopoutManager.getActivePopout(barWindow?.screen);
const hasTransientSurface = activeHoverTrigger !== "" || activePopout?.hoverDismissEnabled === true;
if (hasTransientSurface && !PopoutManager.isActivePopoutPinned(barWindow?.screen))
closeHoverSurfaces();
else
activeHoverTrigger = "";
}
Timer {
id: _hoverIntentTimer
interval: topBarContent.hoverPopoutDelay
@@ -525,6 +546,9 @@ Item {
}
}
if (typeof popout.prepareForTrigger === "function")
popout.prepareForTrigger(spec.triggerSource, mode);
if (spec.prepare)
spec.prepare(popout);
@@ -859,6 +883,10 @@ Item {
const inst = _notepadWidgetForScreen()?.notepadInstance;
return inst?.isVisible ?? false;
}
if (activeHoverTrigger.startsWith("tray-")) {
const screenName = barWindow.screen?.name;
return !!(screenName && TrayMenuManager.activeTrayMenus[screenName]);
}
const popout = PopoutManager.getActivePopout(barWindow?.screen);
if (!popout)
return false;
@@ -1116,12 +1144,19 @@ Item {
if (!PopoutManager.cursorOverBar(_lastHoverGlobalX, _lastHoverGlobalY))
return;
const activePopout = PopoutManager.getActivePopout(barWindow?.screen);
const targetLoader = _loaderForWidgetId(hit.widgetId);
const targetPopout = _resolvePopoutFromLoader(targetLoader);
const managerOwnsTransition = !!(activePopout && targetPopout);
// A different trigger backed by the same already-open popout swaps tab/position
// in place (requestHoverPopout handles it) — don't close+reopen the same surface.
// in place. PopoutManager also owns handoff between loaded popouts, so only
// pre-close special/unmanaged surfaces here.
if (triggerKey !== activeHoverTrigger && activeHoverTrigger !== "" && !_hitTargetsActivePopout(hit)) {
// Mark popout as superseded to fade in-place before closing.
_beginSupersededCloseForActive();
closeHoverSurfaces();
if (!managerOwnsTransition) {
_beginSupersededCloseForActive();
closeHoverSurfaces();
}
}
if (!openHoverPopoutForHit(hit)) {