add animation to ws

This commit is contained in:
lucy 2026-05-18 23:30:45 +02:00
commit 05413904df
2 changed files with 26 additions and 18 deletions

View file

@ -15,7 +15,7 @@ Rectangle {
property HyprlandMonitor hyprBarScreen: Hyprland.monitorFor(root.barScreen)
radius: Config.rounding
color: Colors.base01
implicitWidth: wsLayout.implicitWidth
implicitWidth: wsLayout.implicitWidth
implicitHeight: moduleHeight
RowLayout {
@ -31,7 +31,7 @@ Rectangle {
id: wsWrapper
anchors.verticalCenter: parent.verticalCenter
implicitHeight: root.moduleHeight - 4
implicitWidth: modelData.active ? 48 : 32
implicitWidth: modelData.active ? 48 : 24
parent: wsLayout
color: modelData.active ? Colors.base0D : Colors.base01
radius: Config.rounding
@ -42,6 +42,14 @@ Rectangle {
text: wsWrapper.modelData.id
color: parent.modelData.active ? Colors.base00 : Colors.base07
}
Behavior on implicitWidth {
NumberAnimation {
easing.type: Easing.InOutBack
easing.amplitude: 2
duration: 400
easing.overshoot: 2
}
}
MouseArea {
id: clickHandler
anchors.fill: parent