mirror of
https://github.com/zoriya/noctalia-shell.git
synced 2026-08-15 18:43:59 +00:00
Split secondHandColor into progressColor for DigitalClock so that it can be defined from CalendarPanel
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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 })
|
||||
}
|
||||
|
||||
@@ -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()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user