forked from Shinonome/dots-hyprland
make bg clock color match pixel more
This commit is contained in:
@@ -20,12 +20,12 @@ Item {
|
|||||||
property real implicitSize: 230
|
property real implicitSize: 230
|
||||||
|
|
||||||
property color colShadow: Appearance.colors.colShadow
|
property color colShadow: Appearance.colors.colShadow
|
||||||
property color colBackground: Appearance.colors.colSecondaryContainer
|
property color colBackground: Appearance.colors.colPrimaryContainer
|
||||||
property color colOnBackground: ColorUtils.mix(Appearance.colors.colSecondary, Appearance.colors.colSecondaryContainer, 0.15)
|
property color colOnBackground: ColorUtils.mix(Appearance.colors.colSecondary, Appearance.colors.colPrimaryContainer, 0.15)
|
||||||
property color colBackgroundInfo: ColorUtils.mix(Appearance.colors.colPrimary, Appearance.colors.colSecondaryContainer, 0.55)
|
property color colBackgroundInfo: ColorUtils.mix(Appearance.colors.colPrimary, Appearance.colors.colPrimaryContainer, 0.55)
|
||||||
property color colHourHand: Appearance.colors.colPrimary
|
property color colHourHand: Appearance.colors.colPrimary
|
||||||
property color colMinuteHand: Appearance.colors.colSecondary
|
property color colMinuteHand: Appearance.colors.colTertiary
|
||||||
property color colSecondHand: Appearance.colors.colTertiary
|
property color colSecondHand: Appearance.colors.colPrimary
|
||||||
|
|
||||||
readonly property list<string> clockNumbers: DateTime.time.split(/[: ]/)
|
readonly property list<string> clockNumbers: DateTime.time.split(/[: ]/)
|
||||||
readonly property int clockHour: parseInt(clockNumbers[0]) % 12
|
readonly property int clockHour: parseInt(clockNumbers[0]) % 12
|
||||||
@@ -157,23 +157,10 @@ Item {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Hour hand
|
|
||||||
FadeLoader {
|
|
||||||
anchors.fill: parent
|
|
||||||
z: 1
|
|
||||||
shown: Config.options.background.clock.cookie.hourHandStyle !== "hide"
|
|
||||||
sourceComponent: HourHand {
|
|
||||||
clockHour: root.clockHour
|
|
||||||
clockMinute: root.clockMinute
|
|
||||||
style: Config.options.background.clock.cookie.hourHandStyle
|
|
||||||
color: root.colHourHand
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Minute hand
|
// Minute hand
|
||||||
FadeLoader {
|
FadeLoader {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
z: 2
|
z: 1
|
||||||
shown: Config.options.background.clock.cookie.minuteHandStyle !== "hide"
|
shown: Config.options.background.clock.cookie.minuteHandStyle !== "hide"
|
||||||
sourceComponent: MinuteHand {
|
sourceComponent: MinuteHand {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
@@ -183,6 +170,19 @@ Item {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Hour hand
|
||||||
|
FadeLoader {
|
||||||
|
anchors.fill: parent
|
||||||
|
z: item?.style === "hollow" ? 0 : 2
|
||||||
|
shown: Config.options.background.clock.cookie.hourHandStyle !== "hide"
|
||||||
|
sourceComponent: HourHand {
|
||||||
|
clockHour: root.clockHour
|
||||||
|
clockMinute: root.clockMinute
|
||||||
|
style: Config.options.background.clock.cookie.hourHandStyle
|
||||||
|
color: root.colHourHand
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Second hand
|
// Second hand
|
||||||
FadeLoader {
|
FadeLoader {
|
||||||
id: secondHandLoader
|
id: secondHandLoader
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ Item {
|
|||||||
property string style: "medium"
|
property string style: "medium"
|
||||||
property real handLength: 95
|
property real handLength: 95
|
||||||
property real handWidth: style === "bold" ? 20 : style === "medium" ? 12 : 5
|
property real handWidth: style === "bold" ? 20 : style === "medium" ? 12 : 5
|
||||||
property color color: Appearance.colors.colSecondary
|
property color color: Appearance.colors.colTertiary
|
||||||
|
|
||||||
rotation: -90 + (360 / 60) * root.clockMinute
|
rotation: -90 + (360 / 60) * root.clockMinute
|
||||||
Behavior on rotation {
|
Behavior on rotation {
|
||||||
@@ -34,7 +34,7 @@ Item {
|
|||||||
height: root.handWidth
|
height: root.handWidth
|
||||||
|
|
||||||
radius: root.style === "classic" ? 2 : root.handWidth / 2
|
radius: root.style === "classic" ? 2 : root.handWidth / 2
|
||||||
color: Appearance.colors.colSecondary
|
color: root.color
|
||||||
|
|
||||||
Behavior on height {
|
Behavior on height {
|
||||||
animation: Appearance.animation.elementResize.numberAnimation.createObject(this)
|
animation: Appearance.animation.elementResize.numberAnimation.createObject(this)
|
||||||
|
|||||||
+2
-2
@@ -19,7 +19,7 @@ Item {
|
|||||||
// sides: root.isMonth ? 1 : 4
|
// sides: root.isMonth ? 1 : 4
|
||||||
shape: root.isMonth ? MaterialShape.Shape.Pill : MaterialShape.Shape.Pentagon
|
shape: root.isMonth ? MaterialShape.Shape.Pill : MaterialShape.Shape.Pentagon
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
color: root.isMonth ? Appearance.colors.colPrimaryContainer : Appearance.colors.colTertiaryContainer
|
color: root.isMonth ? Appearance.colors.colSecondaryContainer : Appearance.colors.colTertiaryContainer
|
||||||
implicitSize: targetSize
|
implicitSize: targetSize
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -27,7 +27,7 @@ Item {
|
|||||||
id: bubbleText
|
id: bubbleText
|
||||||
z: 6
|
z: 6
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
color: root.isMonth ? Appearance.colors.colPrimary : Appearance.colors.colTertiary
|
color: root.isMonth ? Appearance.colors.colOnSecondaryContainer : Appearance.colors.colOnTertiaryContainer
|
||||||
font {
|
font {
|
||||||
family: Appearance.font.family.expressive
|
family: Appearance.font.family.expressive
|
||||||
pixelSize: 30
|
pixelSize: 30
|
||||||
|
|||||||
Reference in New Issue
Block a user