hoverpanel: reverse hide animation smoothly instead of snapping closed on re-enter
This commit is contained in:
parent
1c67f002f4
commit
0d62b62da0
1 changed files with 10 additions and 4 deletions
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue