workspace animations

This commit is contained in:
Benjamin Palko 2025-07-19 09:54:02 -04:00
parent d4ffbf685d
commit f6fa998e33

View file

@ -15,9 +15,28 @@ Item {
Rectangle { Rectangle {
id: rectangle id: rectangle
anchors.fill: button anchors.fill: parent
color: Theme.palette.base100 color: Theme.palette.base100
radius: Dimensions.radius radius: Dimensions.radius
states: State {
name: "hovered"
when: button.hovered
PropertyChanges {
rectangle {
color: Theme.palette.primary
}
}
}
transitions: Transition {
from: ""
to: "hovered"
reversible: true
ColorAnimation {
properties: "color"
duration: 300
easing.type: Easing.InOutCubic
}
}
} }
Button { Button {
@ -27,20 +46,18 @@ Item {
verticalPadding: Dimensions.workspace.verticalPadding verticalPadding: Dimensions.workspace.verticalPadding
horizontalPadding: Dimensions.workspace.horizontalPadding horizontalPadding: Dimensions.workspace.horizontalPadding
background: null background: undefined
icon.source: "/home/baobeld/dotfiles/quickshell/assets/triangle.svg" icon.source: "/home/baobeld/dotfiles/quickshell/assets/triangle.svg"
icon.color: Theme.palette.basecontent icon.color: Theme.palette.basecontent
onClicked: workspace.modelData.activate()
states: State { states: State {
name: "active" name: "active"
when: workspace.modelData.active when: workspace.modelData.active
PropertyChanges { PropertyChanges {
button { button {
rotation: 180 rotation: 180
icon.color: Theme.palette.primary icon.color: button.hovered ? Theme.palette.basecontent : Theme.palette.primary
} }
} }
} }
@ -49,11 +66,25 @@ Item {
from: "" from: ""
to: "active" to: "active"
reversible: true reversible: true
NumberAnimation { ParallelAnimation {
properties: "rotation" RotationAnimation {
duration: 250 duration: 300
easing.type: Easing.InOutQuad easing.type: Easing.InOutCubic
}
ColorAnimation {
duration: 300
easing.type: Easing.OutCubic
} }
} }
} }
}
MouseArea {
id: mouseArea
anchors.fill: parent
cursorShape: Qt.PointingHandCursor
onClicked: workspace.modelData.activate()
}
} }