bar: fix height when tray expansion
This commit is contained in:
parent
d191ac44b5
commit
5559490e5f
2 changed files with 12 additions and 7 deletions
|
|
@ -15,7 +15,7 @@ Item {
|
||||||
|
|
||||||
readonly property int maxHeight: {
|
readonly property int maxHeight: {
|
||||||
const otherModules = bar.children.filter(c => c.id && c.item !== this && c.id !== "spacer");
|
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
|
// Length - 2 cause repeater counts as a child
|
||||||
return bar.height - otherHeight - bar.spacing * (bar.children.length - 1) - bar.vPadding * 2;
|
return bar.height - otherHeight - bar.spacing * (bar.children.length - 1) - bar.vPadding * 2;
|
||||||
}
|
}
|
||||||
|
|
@ -62,7 +62,8 @@ Item {
|
||||||
|
|
||||||
Behavior on implicitHeight {
|
Behavior on implicitHeight {
|
||||||
Anim {
|
Anim {
|
||||||
easing.bezierCurve: Appearance.anim.curves.emphasized
|
duration: Appearance.anim.durations.expressiveDefaultSpatial
|
||||||
|
easing.bezierCurve: Appearance.anim.curves.expressiveDefaultSpatial
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -12,19 +12,23 @@ StyledRect {
|
||||||
readonly property alias layout: layout
|
readonly property alias layout: layout
|
||||||
readonly property alias items: items
|
readonly property alias items: items
|
||||||
readonly property alias expandIcon: expandIcon
|
readonly property alias expandIcon: expandIcon
|
||||||
|
|
||||||
readonly property int padding: Config.bar.tray.background ? Appearance.padding.normal : Appearance.padding.small
|
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
|
readonly property int spacing: Config.bar.tray.background ? Appearance.spacing.small : 0
|
||||||
|
|
||||||
property bool expanded
|
property bool expanded
|
||||||
|
|
||||||
|
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
|
clip: true
|
||||||
visible: height > 0
|
visible: height > 0
|
||||||
|
|
||||||
implicitWidth: Config.bar.sizes.innerWidth
|
implicitWidth: Config.bar.sizes.innerWidth
|
||||||
implicitHeight: {
|
implicitHeight: nonAnimHeight
|
||||||
if (!Config.bar.tray.compact)
|
|
||||||
return layout.implicitHeight + padding * 2;
|
|
||||||
return (expanded ? expandIcon.implicitHeight + layout.implicitHeight + spacing : expandIcon.implicitHeight) + padding * 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
color: Qt.alpha(Colours.tPalette.m3surfaceContainer, Config.bar.tray.background ? Colours.tPalette.m3surfaceContainer.a : 0)
|
color: Qt.alpha(Colours.tPalette.m3surfaceContainer, Config.bar.tray.background ? Colours.tPalette.m3surfaceContainer.a : 0)
|
||||||
radius: Appearance.rounding.full
|
radius: Appearance.rounding.full
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue