forked from Shinonome/dots-hyprland
add a lil animation when changing hour hand style
This commit is contained in:
@@ -206,15 +206,31 @@ Item {
|
|||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
z: Config.options.background.clock.cookie.hourHandStyle === "fill" ? 3 : 1
|
z: Config.options.background.clock.cookie.hourHandStyle === "fill" ? 3 : 1
|
||||||
rotation: -90 + (360 / 12) * (root.clockHour + root.clockMinute / 60)
|
rotation: -90 + (360 / 12) * (root.clockHour + root.clockMinute / 60)
|
||||||
|
// Using two different rectangle for animation. Can be used only one with border.color && border.width
|
||||||
Rectangle {
|
Rectangle {
|
||||||
|
// fill
|
||||||
|
opacity: Config.options.background.clock.cookie.hourHandStyle === "fill" ? 1.0 : 0
|
||||||
|
Behavior on opacity {
|
||||||
|
animation: Appearance.animation.elementResize.numberAnimation.createObject(this)
|
||||||
|
}
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
x: parent.width / 2 - hourHandWidth / 2
|
x: parent.width / 2 - hourHandWidth / 2
|
||||||
width: hourHandLength
|
width: hourHandLength
|
||||||
height: hourHandWidth
|
height: hourHandWidth
|
||||||
radius: hourHandWidth / 2
|
radius: hourHandWidth / 2
|
||||||
color: Config.options.background.clock.cookie.hourHandStyle === "stroke" ? "transparent" : root.colHourHand
|
//color: Config.options.background.clock.cookie.hourHandStyle === "stroke" ? "transparent" : root.colHourHand
|
||||||
border.color: Config.options.background.clock.cookie.hourHandStyle === "stroke" ? root.colHourHand : "transparent"
|
color : root.colHourHand
|
||||||
border.width: Config.options.background.clock.cookie.hourHandStyle === "stroke" ? 4 : 0
|
}
|
||||||
|
Rectangle {
|
||||||
|
// border
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
x: parent.width / 2 - hourHandWidth / 2
|
||||||
|
width: hourHandLength
|
||||||
|
height: hourHandWidth
|
||||||
|
radius: hourHandWidth / 2
|
||||||
|
color: "transparent"
|
||||||
|
border.color: root.colHourHand
|
||||||
|
border.width: 4
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user