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)
This commit is contained in:
parent
fffe6f4943
commit
b004edad7d
2 changed files with 11 additions and 13 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue