forked from Shinonome/dots-hyprland
make MinuteMarks not rely on cascading
This commit is contained in:
@@ -72,6 +72,11 @@ Item {
|
|||||||
// Hour/minutes numbers/dots/lines
|
// Hour/minutes numbers/dots/lines
|
||||||
MinuteMarks {
|
MinuteMarks {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
property int hourDotSize: root.hourDotSize
|
||||||
|
property int hourNumberSize: root.hourNumberSize
|
||||||
|
property int hourLineSize: root.hourLineSize
|
||||||
|
property int minuteLineSize: root.minuteLineSize
|
||||||
|
color: root.colOnBackground
|
||||||
}
|
}
|
||||||
HourMarks {
|
HourMarks {
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
|
|||||||
@@ -16,8 +16,7 @@ Item {
|
|||||||
|
|
||||||
Canvas {
|
Canvas {
|
||||||
z: 0
|
z: 0
|
||||||
width: parent.width
|
anchors.fill: parent
|
||||||
height: parent.height
|
|
||||||
rotation: {
|
rotation: {
|
||||||
if (!Config.options.time.secondPrecision) return 0;
|
if (!Config.options.time.secondPrecision) return 0;
|
||||||
return (secondHandLoader.item.rotation + 45); // +45 degrees to align text's center
|
return (secondHandLoader.item.rotation + 45); // +45 degrees to align text's center
|
||||||
|
|||||||
@@ -8,11 +8,20 @@ import qs.modules.common.functions
|
|||||||
import QtQuick
|
import QtQuick
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
|
id: root
|
||||||
|
|
||||||
|
property int hourDotSize: 16
|
||||||
|
property int hourNumberSize: 80
|
||||||
|
property int hourLineSize: 8
|
||||||
|
property int minuteLineSize: 4
|
||||||
|
property color color: Appearance.colors.colOnSecondaryContainer
|
||||||
|
property string style: Config.options.background.clock.cookie.dialNumberStyle // "dots", "numbers", "full", "hide"
|
||||||
|
|
||||||
Repeater {
|
Repeater {
|
||||||
model: 12
|
model: 12
|
||||||
Item {
|
Item {
|
||||||
required property int index
|
required property int index
|
||||||
opacity: Config.options.background.clock.cookie.dialNumberStyle === "dots" ? 1.0 : 0
|
opacity: root.style === "dots" ? 1.0 : 0
|
||||||
rotation: 360 / 12 * index
|
rotation: 360 / 12 * index
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
Behavior on opacity {
|
Behavior on opacity {
|
||||||
@@ -22,7 +31,7 @@ Item {
|
|||||||
anchors {
|
anchors {
|
||||||
left: parent.left
|
left: parent.left
|
||||||
verticalCenter: parent.verticalCenter
|
verticalCenter: parent.verticalCenter
|
||||||
leftMargin: Config.options.background.clock.cookie.dialNumberStyle === "dots" ? 10 : 50
|
leftMargin: root.style === "dots" ? 10 : 50
|
||||||
}
|
}
|
||||||
Behavior on anchors.leftMargin {
|
Behavior on anchors.leftMargin {
|
||||||
animation: Appearance.animation.elementMoveFast.numberAnimation.createObject(this)
|
animation: Appearance.animation.elementMoveFast.numberAnimation.createObject(this)
|
||||||
@@ -30,7 +39,7 @@ Item {
|
|||||||
implicitWidth: root.hourDotSize
|
implicitWidth: root.hourDotSize
|
||||||
implicitHeight: implicitWidth
|
implicitHeight: implicitWidth
|
||||||
radius: implicitWidth / 2
|
radius: implicitWidth / 2
|
||||||
color: root.colOnBackground
|
color: root.color
|
||||||
opacity: 0.5
|
opacity: 0.5
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -41,7 +50,7 @@ Item {
|
|||||||
model: 4
|
model: 4
|
||||||
Item {
|
Item {
|
||||||
required property int index
|
required property int index
|
||||||
opacity: Config.options.background.clock.cookie.dialNumberStyle === "numbers" ? 1.0 : 0
|
opacity: root.style === "numbers" ? 1.0 : 0
|
||||||
rotation: 360 / 4 * index
|
rotation: 360 / 4 * index
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
Behavior on opacity {
|
Behavior on opacity {
|
||||||
@@ -54,13 +63,13 @@ Item {
|
|||||||
anchors {
|
anchors {
|
||||||
left: parent.left
|
left: parent.left
|
||||||
verticalCenter: parent.verticalCenter
|
verticalCenter: parent.verticalCenter
|
||||||
leftMargin: Config.options.background.clock.cookie.dialNumberStyle === "numbers" ? 32 : 96
|
leftMargin: root.style === "numbers" ? 32 : 96
|
||||||
}
|
}
|
||||||
Behavior on anchors.leftMargin {
|
Behavior on anchors.leftMargin {
|
||||||
animation: Appearance.animation.elementMoveFast.numberAnimation.createObject(this)
|
animation: Appearance.animation.elementMoveFast.numberAnimation.createObject(this)
|
||||||
}
|
}
|
||||||
StyledText {
|
StyledText {
|
||||||
color: root.colOnBackground
|
color: root.color
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
text: index === 0 ? "9" :
|
text: index === 0 ? "9" :
|
||||||
index === 1 ? "12" :
|
index === 1 ? "12" :
|
||||||
@@ -83,7 +92,7 @@ Item {
|
|||||||
required property int index
|
required property int index
|
||||||
rotation: 360 / 12 * index
|
rotation: 360 / 12 * index
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
opacity: Config.options.background.clock.cookie.dialNumberStyle === "full" ? 1.0 : 0
|
opacity: root.style === "full" ? 1.0 : 0
|
||||||
Behavior on opacity {
|
Behavior on opacity {
|
||||||
animation: Appearance.animation.elementMoveFast.numberAnimation.createObject(this)
|
animation: Appearance.animation.elementMoveFast.numberAnimation.createObject(this)
|
||||||
}
|
}
|
||||||
@@ -91,11 +100,11 @@ Item {
|
|||||||
implicitWidth: root.hourLineSize * 3.5
|
implicitWidth: root.hourLineSize * 3.5
|
||||||
implicitHeight: root.hourLineSize
|
implicitHeight: root.hourLineSize
|
||||||
radius: implicitWidth / 2
|
radius: implicitWidth / 2
|
||||||
color: root.colOnBackground
|
color: root.color
|
||||||
anchors {
|
anchors {
|
||||||
left: parent.left
|
left: parent.left
|
||||||
verticalCenter: parent.verticalCenter
|
verticalCenter: parent.verticalCenter
|
||||||
leftMargin: Config.options.background.clock.cookie.dialNumberStyle === "full" ? 10 : 50
|
leftMargin: root.style === "full" ? 10 : 50
|
||||||
}
|
}
|
||||||
Behavior on anchors.leftMargin {
|
Behavior on anchors.leftMargin {
|
||||||
animation: Appearance.animation.elementMoveFast.numberAnimation.createObject(this)
|
animation: Appearance.animation.elementMoveFast.numberAnimation.createObject(this)
|
||||||
@@ -110,7 +119,7 @@ Item {
|
|||||||
required property int index
|
required property int index
|
||||||
rotation: 360 / 60 * index
|
rotation: 360 / 60 * index
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
opacity: Config.options.background.clock.cookie.dialNumberStyle === "full" ? 1.0 : 0
|
opacity: root.style === "full" ? 1.0 : 0
|
||||||
Behavior on opacity {
|
Behavior on opacity {
|
||||||
animation: Appearance.animation.elementMoveFast.numberAnimation.createObject(this)
|
animation: Appearance.animation.elementMoveFast.numberAnimation.createObject(this)
|
||||||
}
|
}
|
||||||
@@ -118,12 +127,12 @@ Item {
|
|||||||
implicitWidth: root.minuteLineSize * 3.5
|
implicitWidth: root.minuteLineSize * 3.5
|
||||||
implicitHeight: root.minuteLineSize
|
implicitHeight: root.minuteLineSize
|
||||||
radius: implicitWidth / 2
|
radius: implicitWidth / 2
|
||||||
color: root.colOnBackground
|
color: root.color
|
||||||
opacity: 0.5
|
opacity: 0.5
|
||||||
anchors {
|
anchors {
|
||||||
left: parent.left
|
left: parent.left
|
||||||
verticalCenter: parent.verticalCenter
|
verticalCenter: parent.verticalCenter
|
||||||
leftMargin: Config.options.background.clock.cookie.dialNumberStyle === "full" ? 10 : 50
|
leftMargin: root.style === "full" ? 10 : 50
|
||||||
}
|
}
|
||||||
Behavior on anchors.leftMargin {
|
Behavior on anchors.leftMargin {
|
||||||
animation: Appearance.animation.elementMoveFast.numberAnimation.createObject(this)
|
animation: Appearance.animation.elementMoveFast.numberAnimation.createObject(this)
|
||||||
|
|||||||
@@ -131,11 +131,11 @@ Singleton {
|
|||||||
property real scale: 1
|
property real scale: 1
|
||||||
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: "classic", "fill", "stroke", "hide"
|
property string hourHandStyle: "fill" // Options: "classic", "fill", "stroke", "hide"
|
||||||
property string minuteHandStyle: "medium" // Options: "classic", "thin", "medium", "bold", "hide"
|
property string minuteHandStyle: "medium" // Options "classic", "thin", "medium", "bold", "hide"
|
||||||
property string secondHandStyle: "dot" // Options: "dot", "line" , "none"
|
property string secondHandStyle: "dot" // Options: "dot", "line" , "none"
|
||||||
property string dateStyle: "rotating" // Options: "rotating", "rect", "bubble" , "none"
|
property string dateStyle: "rotating" // Options: "rotating", "rect", "bubble" , "none"
|
||||||
property bool timeIndicators: true
|
property bool timeIndicators: true
|
||||||
property bool hourMarks: true
|
property bool hourMarks: true
|
||||||
property bool dateInClock: true
|
property bool dateInClock: true
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ ContentPage {
|
|||||||
|
|
||||||
ContentSubsection {
|
ContentSubsection {
|
||||||
visible: Config.options.background.clock.style === "cookie"
|
visible: Config.options.background.clock.style === "cookie"
|
||||||
title: Translation.tr("Dial number style")
|
title: Translation.tr("Dial numbers style")
|
||||||
ConfigSelectionArray {
|
ConfigSelectionArray {
|
||||||
currentValue: Config.options.background.clock.cookie.dialNumberStyle
|
currentValue: Config.options.background.clock.cookie.dialNumberStyle
|
||||||
onSelected: newValue => {
|
onSelected: newValue => {
|
||||||
|
|||||||
Reference in New Issue
Block a user