forked from Shinonome/dots-hyprland
button color anims
This commit is contained in:
@@ -4,6 +4,7 @@ pragma Singleton
|
|||||||
|
|
||||||
Singleton {
|
Singleton {
|
||||||
property QtObject m3colors
|
property QtObject m3colors
|
||||||
|
property QtObject animation
|
||||||
property QtObject colors
|
property QtObject colors
|
||||||
property QtObject rounding
|
property QtObject rounding
|
||||||
property QtObject font
|
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 {
|
Button {
|
||||||
id: button
|
id: button
|
||||||
implicitWidth: 26
|
|
||||||
implicitHeight: 26
|
|
||||||
|
|
||||||
required default property Item content
|
required default property Item content
|
||||||
property bool extraActiveCondition: false
|
property bool extraActiveCondition: false
|
||||||
|
|
||||||
|
implicitWidth: 26
|
||||||
|
implicitHeight: 26
|
||||||
contentItem: content
|
contentItem: content
|
||||||
|
|
||||||
background: Rectangle {
|
background: Rectangle {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
radius: Appearance.rounding.full
|
radius: Appearance.rounding.full
|
||||||
color: (button.down || extraActiveCondition) ? Appearance.colors.colLayer2Active : (button.hovered ? Appearance.colors.colLayer2Hover : Appearance.colors.colLayer2)
|
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