From b004edad7d41d6a868222e1252862817d7dac52d Mon Sep 17 00:00:00 2001 From: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> Date: Mon, 20 Apr 2026 00:27:05 +1000 Subject: [PATCH] feat: improve sidebar notif expand anim No layout so no shifting from pixel alignment Also remove top/bottom margins (were causing some weird position glitches) --- modules/sidebar/NotifGroup.qml | 20 +++++++++----------- modules/sidebar/NotifGroupList.qml | 4 ++-- 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/modules/sidebar/NotifGroup.qml b/modules/sidebar/NotifGroup.qml index aecefdb2..25f531ec 100644 --- a/modules/sidebar/NotifGroup.qml +++ b/modules/sidebar/NotifGroup.qml @@ -52,7 +52,7 @@ StyledRect { readonly property int nonAnimHeight: { const headerHeight = header.implicitHeight + (root.expanded ? Math.round(Tokens.spacing.small / 2) : 0); - const columnHeight = headerHeight + notifList.layoutHeight + column.Layout.topMargin + column.Layout.bottomMargin; + const columnHeight = headerHeight + notifList.layoutHeight; return Math.round(Math.max(TokenConfig.sizes.notifs.image, columnHeight) + Tokens.padding.normal * 2); } readonly property bool expanded: props.expandedNotifs.includes(modelData) @@ -172,19 +172,21 @@ StyledRect { } } - ColumnLayout { + Column { id: column - Layout.topMargin: -Tokens.padding.small - Layout.bottomMargin: -Tokens.padding.small / 2 Layout.fillWidth: true - spacing: 0 + spacing: root.expanded ? Math.round(Tokens.spacing.small / 2) : 0 + + Behavior on spacing { + Anim {} + } RowLayout { id: header - Layout.bottomMargin: root.expanded ? Math.round(Tokens.spacing.small / 2) : 0 - Layout.fillWidth: true + anchors.left: parent.left + anchors.right: parent.right spacing: Tokens.spacing.smaller StyledText { @@ -251,10 +253,6 @@ StyledRect { } } } - - Behavior on Layout.bottomMargin { - Anim {} - } } NotifGroupList { diff --git a/modules/sidebar/NotifGroupList.qml b/modules/sidebar/NotifGroupList.qml index 75e79040..72b8b3a8 100644 --- a/modules/sidebar/NotifGroupList.qml +++ b/modules/sidebar/NotifGroupList.qml @@ -1,7 +1,6 @@ pragma ComponentBehavior: Bound import QtQuick -import QtQuick.Layouts import Quickshell import Caelestia.Components import Caelestia.Config @@ -19,7 +18,8 @@ LazyListView { signal requestToggleExpand(expand: bool) - Layout.fillWidth: true + anchors.left: parent.left + anchors.right: parent.right implicitHeight: contentHeight spacing: Math.round(Tokens.spacing.small / 2)