From 0d62b62da020c54aff3c26c6ad1eec9bd0c47180 Mon Sep 17 00:00:00 2001 From: Damocles Date: Fri, 17 Apr 2026 11:35:37 +0200 Subject: [PATCH] hoverpanel: reverse hide animation smoothly instead of snapping closed on re-enter --- modules/HoverPanel.qml | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/modules/HoverPanel.qml b/modules/HoverPanel.qml index 7ffd20f..5072c92 100644 --- a/modules/HoverPanel.qml +++ b/modules/HoverPanel.qml @@ -120,10 +120,16 @@ PanelWindow { function _show() { _updatePosition(); - // Explicitly set y before animating — avoids the y:-height binding (live, depends on - // _panelColumn.height) surviving a 0→0 no-op animation when layout isn't done yet. - panelContainer.y = -(panelContainer.height > 0 ? panelContainer.height : 400); - panelContainer.opacity = 0; + // Only snap to closed position when genuinely opening from scratch. + // If we are interrupting a hide animation, animate back from the current + // y/opacity so there's no visible jump — the showAnim NumberAnimations + // always run from the *current* value to their target. + if (!hideAnim.running) { + // Explicitly set y before animating — avoids the y:-height binding (live, depends on + // _panelColumn.height) surviving a 0→0 no-op animation when layout isn't done yet. + panelContainer.y = -(panelContainer.height > 0 ? panelContainer.height : 400); + panelContainer.opacity = 0; + } _winVisible = true; hideAnim.stop(); showAnim.start();