hoverpanel: reverse hide animation smoothly instead of snapping closed on re-enter

This commit is contained in:
Damocles 2026-04-17 11:35:37 +02:00
parent 1c67f002f4
commit 0d62b62da0

View file

@ -120,10 +120,16 @@ PanelWindow {
function _show() { function _show() {
_updatePosition(); _updatePosition();
// Explicitly set y before animating avoids the y:-height binding (live, depends on // Only snap to closed position when genuinely opening from scratch.
// _panelColumn.height) surviving a 00 no-op animation when layout isn't done yet. // If we are interrupting a hide animation, animate back from the current
panelContainer.y = -(panelContainer.height > 0 ? panelContainer.height : 400); // y/opacity so there's no visible jump the showAnim NumberAnimations
panelContainer.opacity = 0; // 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 00 no-op animation when layout isn't done yet.
panelContainer.y = -(panelContainer.height > 0 ? panelContainer.height : 400);
panelContainer.opacity = 0;
}
_winVisible = true; _winVisible = true;
hideAnim.stop(); hideAnim.stop();
showAnim.start(); showAnim.start();