From 724cdded4c2f529cebd76a7341e96556ac9625d4 Mon Sep 17 00:00:00 2001 From: rope Date: Fri, 12 Jun 2026 09:44:19 +0100 Subject: [PATCH] =?UTF-8?q?quickshell:=20flush=20dropdowns=20live=20anchor?= =?UTF-8?q?ed=20to=20the=20column=20=E2=80=94=20grow=20down-left,=20shrink?= =?UTF-8?q?=20back=20into=20it?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Fable 5 --- settings/quickshell.nix | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/settings/quickshell.nix b/settings/quickshell.nix index adf538c..88d096e 100644 --- a/settings/quickshell.nix +++ b/settings/quickshell.nix @@ -1299,13 +1299,11 @@ in property real openH: bar.activeDropdown ? tH : 0 property bool snap: false readonly property real stubW: 32 - // Melt toward the frame column whenever a flush dropdown - // is the active target — the geometric melt runs during - // the approach and un-melts during departure. (A previous - // contact-detection compare against animated float - // geometry proved unreliable on scaled displays.) + // Merged whenever the (latched) target is a flush dropdown + // and the panel is on screen — flush panels are born, + // live and close merged; the melt only animates for + // morphs between flush and centered dropdowns. readonly property bool mergedRight: visible && flushRight - && bar.activeDropdown !== null // Grow-from / shrink-to the widget that owns the dropdown: // the panel opens as a small stub on the button and @@ -1314,14 +1312,19 @@ in function stubX(dd) { return Math.round(Math.min(bar.width - Theme.frameWidth - stubW, Math.max(Theme.frameWidth, dd.dropdownX - stubW / 2))); } + // Flush dropdowns keep their right edge welded to the + // frame column: they grow down-and-left from a stub + // parked at the column and shrink back into it. (x and + // width share one animation curve, so x+width — the right + // edge — is constant mid-flight.) function seedFromButton(dd) { snap = true; - tX = stubX(dd); + tX = dd.alignRight ? bar.width - Theme.frameWidth - stubW : stubX(dd); tW = stubW; snap = false; } function shrinkToButton(dd) { - tX = stubX(dd); + tX = dd.alignRight ? bar.width - Theme.frameWidth - stubW : stubX(dd); tW = stubW; } @@ -1374,6 +1377,10 @@ in // flare — one shape the whole way. property real mergeP: mergedRight ? 1 : 0 Behavior on mergeP { + // Only animate while the panel is on screen — flush + // panels opening from closed are born merged, no + // visible melt-in at birth. + enabled: chrome.height > 0.5 NumberAnimation { duration: 150; easing.type: Easing.OutCubic } }