quickshell: flush dropdowns live anchored to the column — grow down-left, shrink back into it
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
parent
ad2cbd0eaa
commit
724cdded4c
1 changed files with 15 additions and 8 deletions
|
|
@ -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 }
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue