Split secondHandColor into progressColor for DigitalClock so that it can be defined from CalendarPanel

This commit is contained in:
Corey Woodworth
2025-10-30 00:00:42 -04:00
parent f39ea9e704
commit ddb0b90ef7
3 changed files with 10 additions and 4 deletions
+1 -1
View File
@@ -219,8 +219,8 @@ NPanel {
anchors.right: parent.right
anchors.rightMargin: Style.marginM
anchors.verticalCenter: parent.verticalCenter
progressColor: Color.mOnPrimary
Layout.alignment: Qt.AlignVCenter
now: root.now
}
}
+7 -1
View File
@@ -49,6 +49,7 @@ Item {
return bestColor
}
property color progressColor: clockRoot.secondHandColor
height: Math.round((Style.fontSizeXXXL * 1.9) / 2 * Style.uiScaleRatio) * 2
@@ -64,7 +65,12 @@ Item {
item.now = Qt.binding(function() { return clockRoot.now })
item.backgroundColor = Qt.binding(function() { return clockRoot.backgroundColor })
item.clockColor = Qt.binding(function() { return clockRoot.clockColor })
item.secondHandColor = Qt.binding(function() { return clockRoot.secondHandColor })
if (item.hasOwnProperty("secondHandColor")) {
item.secondHandColor = Qt.binding(function() { return clockRoot.secondHandColor })
}
if (item.hasOwnProperty("progressColor")) {
item.progressColor = Qt.binding(function() { return clockRoot.progressColor })
}
if (item.hasOwnProperty("markAlpha")) {
item.markAlpha = Qt.binding(function() { return clockRoot.markAlpha })
}
+2 -2
View File
@@ -9,7 +9,7 @@ Item {
property var now
property color backgroundColor: Color.mPrimary
property color clockColor: Color.mOnPrimary
property color secondHandColor: Color.mError
property color progressColor: Color.mError
anchors.fill: parent
// Digital clock's seconds circular progress
@@ -43,7 +43,7 @@ Item {
ctx.beginPath()
ctx.arc(centerX, centerY, radius, -Math.PI / 2, -Math.PI / 2 + progress * 2 * Math.PI)
ctx.lineWidth = 2.5
ctx.strokeStyle = secondHandColor
ctx.strokeStyle = progressColor
ctx.lineCap = "round"
ctx.stroke()
}