diff options
| author | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-09-25 16:20:41 +1000 |
|---|---|---|
| committer | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-09-25 16:20:41 +1000 |
| commit | 5559490e5ff4672fed5027a8519e88fe9da8c5ac (patch) | |
| tree | 31c8e89f69474f14aa28ec282b9d4a792be5542c | |
| parent | bar: add compact tray option (diff) | |
| download | caelestia-shell-5559490e5ff4672fed5027a8519e88fe9da8c5ac.tar.gz caelestia-shell-5559490e5ff4672fed5027a8519e88fe9da8c5ac.tar.bz2 caelestia-shell-5559490e5ff4672fed5027a8519e88fe9da8c5ac.zip | |
bar: fix height when tray expansion
| -rw-r--r-- | modules/bar/components/ActiveWindow.qml | 5 | ||||
| -rw-r--r-- | modules/bar/components/Tray.qml | 14 |
2 files changed, 12 insertions, 7 deletions
diff --git a/modules/bar/components/ActiveWindow.qml b/modules/bar/components/ActiveWindow.qml index 28cf133..67e7c69 100644 --- a/modules/bar/components/ActiveWindow.qml +++ b/modules/bar/components/ActiveWindow.qml @@ -15,7 +15,7 @@ Item { readonly property int maxHeight: { const otherModules = bar.children.filter(c => c.id && c.item !== this && c.id !== "spacer"); - const otherHeight = otherModules.reduce((acc, curr) => acc + curr.height, 0); + const otherHeight = otherModules.reduce((acc, curr) => acc + (curr.item.nonAnimHeight ?? curr.height), 0); // Length - 2 cause repeater counts as a child return bar.height - otherHeight - bar.spacing * (bar.children.length - 1) - bar.vPadding * 2; } @@ -62,7 +62,8 @@ Item { Behavior on implicitHeight { Anim { - easing.bezierCurve: Appearance.anim.curves.emphasized + duration: Appearance.anim.durations.expressiveDefaultSpatial + easing.bezierCurve: Appearance.anim.curves.expressiveDefaultSpatial } } diff --git a/modules/bar/components/Tray.qml b/modules/bar/components/Tray.qml index cf865fe..efd0c3a 100644 --- a/modules/bar/components/Tray.qml +++ b/modules/bar/components/Tray.qml @@ -12,20 +12,24 @@ StyledRect { readonly property alias layout: layout readonly property alias items: items readonly property alias expandIcon: expandIcon + readonly property int padding: Config.bar.tray.background ? Appearance.padding.normal : Appearance.padding.small readonly property int spacing: Config.bar.tray.background ? Appearance.spacing.small : 0 - property bool expanded - clip: true - visible: height > 0 + property bool expanded - implicitWidth: Config.bar.sizes.innerWidth - implicitHeight: { + readonly property real nonAnimHeight: { if (!Config.bar.tray.compact) return layout.implicitHeight + padding * 2; return (expanded ? expandIcon.implicitHeight + layout.implicitHeight + spacing : expandIcon.implicitHeight) + padding * 2; } + clip: true + visible: height > 0 + + implicitWidth: Config.bar.sizes.innerWidth + implicitHeight: nonAnimHeight + color: Qt.alpha(Colours.tPalette.m3surfaceContainer, Config.bar.tray.background ? Colours.tPalette.m3surfaceContainer.a : 0) radius: Appearance.rounding.full |