bar: workspaces some fixes

And anim occupied pill movement
This commit is contained in:
2 * r + 2 * t 2025-04-30 12:35:47 +10:00
parent db65e7ca3e
commit 5c3f27f332
3 changed files with 12 additions and 7 deletions

View file

@ -29,7 +29,7 @@ Item {
count++; count++;
} }
if (!occupied[ws + 1]) if (!occupied[ws + 1])
pills[pills.length - 1].end = ws; pills[count - 1].end = ws;
} }
} }
if (pills.length > count) if (pills.length > count)
@ -42,7 +42,7 @@ Item {
Repeater { Repeater {
model: ScriptModel { model: ScriptModel {
values: root.pills values: root.pills.filter(p => p)
} }
Rectangle { Rectangle {
@ -81,6 +81,14 @@ Item {
} }
} }
Behavior on x {
Anim {}
}
Behavior on y {
Anim {}
}
Behavior on width { Behavior on width {
Anim {} Anim {}
} }

View file

@ -6,7 +6,6 @@ import QtQuick.Layouts
StyledText { StyledText {
required property int index required property int index
required property bool vertical required property bool vertical
required property bool homogenous
required property var occupied required property var occupied
required property int groupOffset required property int groupOffset
@ -19,6 +18,6 @@ StyledText {
color: BarConfig.workspaces.occupiedBg || occupied[ws] ? Appearance.colours.text : Appearance.colours.subtext0 color: BarConfig.workspaces.occupiedBg || occupied[ws] ? Appearance.colours.text : Appearance.colours.subtext0
horizontalAlignment: StyledText.AlignHCenter horizontalAlignment: StyledText.AlignHCenter
Layout.preferredWidth: homogenous && !vertical ? BarConfig.sizes.innerHeight : -1 Layout.minimumWidth: vertical ? -1 : BarConfig.sizes.innerHeight
Layout.preferredHeight: homogenous && vertical ? BarConfig.sizes.innerHeight : -1 Layout.minimumHeight: vertical ? BarConfig.sizes.innerHeight : -1
} }

View file

@ -22,7 +22,6 @@ Item {
BoxLayout { BoxLayout {
id: layout id: layout
homogenous: true
spacing: 0 spacing: 0
Repeater { Repeater {
@ -30,7 +29,6 @@ Item {
Workspace { Workspace {
vertical: root.vertical vertical: root.vertical
homogenous: layout.homogenous
occupied: root.occupied occupied: root.occupied
groupOffset: root.groupOffset groupOffset: root.groupOffset
} }