forked from Shinonome/dots-hyprland
add hour hand style
This commit is contained in:
@@ -22,7 +22,7 @@ Item {
|
|||||||
property real hourHandWidth: 20
|
property real hourHandWidth: 20
|
||||||
property real minuteHandLength: 95
|
property real minuteHandLength: 95
|
||||||
property real minuteHandWidth: Config.options.background.clock.cookie.minuteHandStyle === "bold" ? hourHandWidth :
|
property real minuteHandWidth: Config.options.background.clock.cookie.minuteHandStyle === "bold" ? hourHandWidth :
|
||||||
Config.options.background.clock.cookie.minuteHandStyle === "medium" ? 12 : 6
|
Config.options.background.clock.cookie.minuteHandStyle === "medium" ? 12 : 5
|
||||||
property real centerDotSize: 10
|
property real centerDotSize: 10
|
||||||
property real hourDotSize: 12
|
property real hourDotSize: 12
|
||||||
property real centerGlowSize: 135
|
property real centerGlowSize: 135
|
||||||
@@ -204,7 +204,7 @@ Item {
|
|||||||
// Hour hand
|
// Hour hand
|
||||||
Item {
|
Item {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
z: 3
|
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)
|
||||||
Rectangle {
|
Rectangle {
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
@@ -212,7 +212,9 @@ Item {
|
|||||||
width: hourHandLength
|
width: hourHandLength
|
||||||
height: hourHandWidth
|
height: hourHandWidth
|
||||||
radius: hourHandWidth / 2
|
radius: hourHandWidth / 2
|
||||||
color: 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"
|
||||||
|
border.width: Config.options.background.clock.cookie.hourHandStyle === "stroke" ? 4 : 0
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -239,12 +241,12 @@ Item {
|
|||||||
|
|
||||||
// Center dot
|
// Center dot
|
||||||
Rectangle {
|
Rectangle {
|
||||||
opacity: Config.options.background.clock.cookie.minuteHandStyle === "medium" ? 1.0 : 0 // Not using visible to allow smooth transition
|
opacity: Config.options.background.clock.cookie.minuteHandStyle !== "bold" ? 1.0 : 0 // Not using visible to allow smooth transition
|
||||||
Behavior on opacity {
|
Behavior on opacity {
|
||||||
animation: Appearance.animation.elementMoveFast.numberAnimation.createObject(this)
|
animation: Appearance.animation.elementMoveFast.numberAnimation.createObject(this)
|
||||||
}
|
}
|
||||||
z: 4
|
z: 4
|
||||||
color: root.colOnHourHand
|
color: Config.options.background.clock.cookie.minuteHandStyle === "medium" ? root.colBackground : root.colMinuteHand
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
implicitWidth: centerDotSize
|
implicitWidth: centerDotSize
|
||||||
implicitHeight: implicitWidth
|
implicitHeight: implicitWidth
|
||||||
|
|||||||
@@ -132,6 +132,7 @@ Singleton {
|
|||||||
property int clockSides: 12
|
property int clockSides: 12
|
||||||
property JsonObject cookie: JsonObject {
|
property JsonObject cookie: JsonObject {
|
||||||
property string dialNumberStyle: "dots" // Options: "dots" , "numbers", "full" , "none"
|
property string dialNumberStyle: "dots" // Options: "dots" , "numbers", "full" , "none"
|
||||||
|
property string hourHandStyle: "fill" // Options: "fill", "stroke"
|
||||||
property string minuteHandStyle: "medium" // Options: "medium", "bold"
|
property string minuteHandStyle: "medium" // Options: "medium", "bold"
|
||||||
property string secondHandStyle: "dot" // Options: "dot", "line" , "none"
|
property string secondHandStyle: "dot" // Options: "dot", "line" , "none"
|
||||||
property string dateStyle: "rotating" // Options: "rotating", "square", "none"
|
property string dateStyle: "rotating" // Options: "rotating", "square", "none"
|
||||||
|
|||||||
@@ -204,6 +204,30 @@ ContentPage {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ContentSubsection {
|
||||||
|
enabled: Config.options.background.clock.style === "cookie"
|
||||||
|
visible: Config.options.background.clock.style === "cookie"
|
||||||
|
title: Translation.tr("Hour hand style")
|
||||||
|
ConfigSelectionArray {
|
||||||
|
currentValue: Config.options.background.clock.cookie.hourHandStyle
|
||||||
|
onSelected: newValue => {
|
||||||
|
Config.options.background.clock.cookie.hourHandStyle = newValue;
|
||||||
|
}
|
||||||
|
options: [
|
||||||
|
{
|
||||||
|
displayName: Translation.tr("Fill"),
|
||||||
|
icon: "stroke_full",
|
||||||
|
value: "fill"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
displayName: Translation.tr("Stroke"),
|
||||||
|
icon: "stroke_partial",
|
||||||
|
value: "stroke"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ConfigSpinBox {
|
ConfigSpinBox {
|
||||||
enabled: Config.options.background.clock.style === "cookie"
|
enabled: Config.options.background.clock.style === "cookie"
|
||||||
visible: Config.options.background.clock.style === "cookie"
|
visible: Config.options.background.clock.style === "cookie"
|
||||||
|
|||||||
Reference in New Issue
Block a user