diff options
| author | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-06-07 20:15:41 +1000 |
|---|---|---|
| committer | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-06-07 20:15:41 +1000 |
| commit | 82756b28664b0f36da9e500a1a9d82112389e1f3 (patch) | |
| tree | e17935cb4b45371b8e95ccca1e6038ad5d06819e /modules/bar/popouts/Content.qml | |
| parent | popouts: fix bottom glitch (diff) | |
| download | caelestia-shell-82756b28664b0f36da9e500a1a9d82112389e1f3.tar.gz caelestia-shell-82756b28664b0f36da9e500a1a9d82112389e1f3.tar.bz2 caelestia-shell-82756b28664b0f36da9e500a1a9d82112389e1f3.zip | |
popouts: reload tray menu on show
Diffstat (limited to 'modules/bar/popouts/Content.qml')
| -rw-r--r-- | modules/bar/popouts/Content.qml | 42 |
1 files changed, 30 insertions, 12 deletions
diff --git a/modules/bar/popouts/Content.qml b/modules/bar/popouts/Content.qml index 38fcb22..43a0a09 100644 --- a/modules/bar/popouts/Content.qml +++ b/modules/bar/popouts/Content.qml @@ -15,16 +15,6 @@ Item { property real currentCenter property bool hasCurrent - Behavior on currentCenter { - enabled: root.implicitWidth > 0 - - NumberAnimation { - duration: Appearance.anim.durations.normal - easing.type: Easing.BezierSpline - easing.bezierCurve: Appearance.anim.curves.emphasized - } - } - anchors.centerIn: parent implicitWidth: hasCurrent ? (content.children.find(c => c.shouldBeActive)?.implicitWidth ?? 0) + Appearance.padding.large * 2 : 0 @@ -70,8 +60,26 @@ Item { required property int index name: `traymenu${index}` - sourceComponent: TrayMenu { - trayItem: trayMenu.modelData.menu + sourceComponent: trayMenuComp + + Connections { + target: root + + function onHasCurrentChanged(): void { + if (root.hasCurrent && trayMenu.shouldBeActive) { + trayMenu.sourceComponent = null; + trayMenu.sourceComponent = trayMenuComp; + } + } + } + + Component { + id: trayMenuComp + + TrayMenu { + popouts: root + trayItem: trayMenu.modelData.menu + } } } } @@ -91,6 +99,16 @@ Item { } } + Behavior on currentCenter { + enabled: root.implicitWidth > 0 + + NumberAnimation { + duration: Appearance.anim.durations.normal + easing.type: Easing.BezierSpline + easing.bezierCurve: Appearance.anim.curves.emphasized + } + } + component Popout: Loader { id: popout |