quickshell: restore grow-from-origin dropdown animation

seedFromButton went back to snapping only long enough to place the
stub, then releasing so tY/tH/openW all animate out to target. Holding
the snap through the grow pinned the height to its final value, so
panels slid out already full height instead of growing from the icon.

With the seed gate fixed in the previous commit, the three paths are
the ones the top bar had: open from closed seeds a stub at the widget
and grows both axes, close shrinks back to that stub, and switching
between dropdowns skips the seed so the bindings just retarget and the
panel morphs from one shape into the next.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
rope 2026-07-28 14:50:54 +01:00
parent 3136780cd4
commit 105066c7c4

View file

@ -2048,23 +2048,16 @@ in
function stubY(dd) {
return Math.round(Math.min(bar.height - Theme.frameWidth - stubH, Math.max(Theme.frameWidth, dd.dropdownY - stubH / 2)));
}
// Snap ONLY long enough to place the stub, then release so
// both axes animate out to the target: the panel grows
// from a small point on the widget rather than sliding out
// at full height. Holding the snap through the grow is
// what made it arrive pre-grown vertically.
function seedFromButton(dd) {
snap = true;
tY = stubY(dd);
tH = stubH;
// Stay snapped for the length of the grow, rather than
// unsnapping immediately. The panel then expands along
// ONE axis width at whatever height its content is
// right now, and content that lands mid-grow (async
// DBus tray menus) is followed instantly instead of
// kicking off a second, visibly separate animation.
_unsnap.restart();
}
Timer {
id: _unsnap
interval: Theme.animMorph
onTriggered: chrome.snap = false
snap = false;
}
function shrinkToButton(dd) {
tY = stubY(dd);
@ -2125,10 +2118,9 @@ in
id: menuOpener
}
// Opens immediately never wait on the menu. Late content
// is handled by the chrome staying snapped for the length
// of the grow (see seedFromButton), so the height follows
// instantly instead of starting a second animation.
// Opens immediately never wait on the menu. Hovering the
// icon has already started the DBus fetch (see the tray
// MouseArea), so the size is normally settled by click.
function openFor(item, y) {
dropdownY = y;
trayItem = item;