forked from Shinonome/dots-hyprland
button color anims
This commit is contained in:
@@ -4,6 +4,7 @@ pragma Singleton
|
||||
|
||||
Singleton {
|
||||
property QtObject m3colors
|
||||
property QtObject animation
|
||||
property QtObject colors
|
||||
property QtObject rounding
|
||||
property QtObject font
|
||||
@@ -138,4 +139,12 @@ Singleton {
|
||||
}
|
||||
}
|
||||
|
||||
animation: QtObject {
|
||||
property QtObject elementDecel: QtObject {
|
||||
property int duration: 100
|
||||
property int type: Easing.BezierSpline
|
||||
property list<real> bezierCurve: [0, 0.55, 0.45, 1]
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -8,18 +8,28 @@ import Quickshell.Wayland
|
||||
|
||||
Button {
|
||||
id: button
|
||||
implicitWidth: 26
|
||||
implicitHeight: 26
|
||||
|
||||
required default property Item content
|
||||
property bool extraActiveCondition: false
|
||||
|
||||
implicitWidth: 26
|
||||
implicitHeight: 26
|
||||
contentItem: content
|
||||
|
||||
background: Rectangle {
|
||||
anchors.fill: parent
|
||||
radius: Appearance.rounding.full
|
||||
color: (button.down || extraActiveCondition) ? Appearance.colors.colLayer2Active : (button.hovered ? Appearance.colors.colLayer2Hover : Appearance.colors.colLayer2)
|
||||
|
||||
Behavior on color {
|
||||
ColorAnimation {
|
||||
duration: Appearance.animation.elementDecel.duration
|
||||
easing.type: Appearance.animation.elementDecel.type
|
||||
easing.bezierCurve: Appearance.animation.elementDecel.bezierCurve
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user