forked from Shinonome/dots-hyprland
cookie clock: put color props to root
This commit is contained in:
@@ -3,6 +3,7 @@ pragma ComponentBehavior: Bound
|
|||||||
import qs
|
import qs
|
||||||
import qs.services
|
import qs.services
|
||||||
import qs.modules.common
|
import qs.modules.common
|
||||||
|
import qs.modules.common.models
|
||||||
import qs.modules.common.widgets
|
import qs.modules.common.widgets
|
||||||
import qs.modules.common.functions as CF
|
import qs.modules.common.functions as CF
|
||||||
import QtQuick
|
import QtQuick
|
||||||
@@ -64,7 +65,7 @@ Variants {
|
|||||||
}
|
}
|
||||||
// Colors
|
// Colors
|
||||||
property bool shouldBlur: (GlobalStates.screenLocked && Config.options.lock.blur.enable)
|
property bool shouldBlur: (GlobalStates.screenLocked && Config.options.lock.blur.enable)
|
||||||
property color dominantColor: Appearance.colors.colPrimary
|
property color dominantColor: Appearance.colors.colPrimary // Default, to be changed
|
||||||
property bool dominantColorIsDark: dominantColor.hslLightness < 0.5
|
property bool dominantColorIsDark: dominantColor.hslLightness < 0.5
|
||||||
property color colText: {
|
property color colText: {
|
||||||
if (wallpaperSafetyTriggered)
|
if (wallpaperSafetyTriggered)
|
||||||
|
|||||||
@@ -20,11 +20,17 @@ Item {
|
|||||||
property real minuteHandWidth: 8
|
property real minuteHandWidth: 8
|
||||||
property real centerDotSize: 10
|
property real centerDotSize: 10
|
||||||
property real hourDotSize: minuteHandWidth
|
property real hourDotSize: minuteHandWidth
|
||||||
property color colOnBackground: ColorUtils.mix(Appearance.colors.colPrimary, Appearance.colors.colSecondaryContainer, 0.5)
|
|
||||||
|
|
||||||
property list<string> clockNumbers: DateTime.time.split(/[: ]/)
|
property color colShadow: Appearance.colors.colShadow
|
||||||
property int clockHour: parseInt(clockNumbers[0]) % 12
|
property color colBackground: Appearance.colors.colSecondaryContainer
|
||||||
property int clockMinute: parseInt(clockNumbers[1])
|
property color colOnBackground: ColorUtils.mix(Appearance.colors.colPrimary, Appearance.colors.colSecondaryContainer, 0.5)
|
||||||
|
property color colHourHand: Appearance.colors.colPrimary
|
||||||
|
property color colMinuteHand: Appearance.colors.colSecondary
|
||||||
|
property color colOnHourHand: Appearance.colors.colOnPrimary
|
||||||
|
|
||||||
|
readonly property list<string> clockNumbers: DateTime.time.split(/[: ]/)
|
||||||
|
readonly property int clockHour: parseInt(clockNumbers[0]) % 12
|
||||||
|
readonly property int clockMinute: parseInt(clockNumbers[1])
|
||||||
implicitWidth: implicitSize
|
implicitWidth: implicitSize
|
||||||
implicitHeight: implicitSize
|
implicitHeight: implicitSize
|
||||||
|
|
||||||
@@ -35,7 +41,7 @@ Item {
|
|||||||
verticalOffset: 2
|
verticalOffset: 2
|
||||||
radius: 12
|
radius: 12
|
||||||
samples: radius * 2 + 1
|
samples: radius * 2 + 1
|
||||||
color: Appearance.colors.colShadow
|
color: root.colShadow
|
||||||
transparentBorder: true
|
transparentBorder: true
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -45,7 +51,7 @@ Item {
|
|||||||
implicitSize: root.implicitSize
|
implicitSize: root.implicitSize
|
||||||
amplitude: implicitSize / 70
|
amplitude: implicitSize / 70
|
||||||
sides: 12
|
sides: 12
|
||||||
color: Appearance.colors.colSecondaryContainer
|
color: root.colBackground
|
||||||
|
|
||||||
// 12 dots around the cookie
|
// 12 dots around the cookie
|
||||||
Repeater {
|
Repeater {
|
||||||
@@ -105,7 +111,7 @@ Item {
|
|||||||
width: hourHandLength
|
width: hourHandLength
|
||||||
height: hourHandWidth
|
height: hourHandWidth
|
||||||
radius: hourHandWidth / 2
|
radius: hourHandWidth / 2
|
||||||
color: Appearance.colors.colPrimary
|
color: root.colHourHand
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -120,14 +126,14 @@ Item {
|
|||||||
width: minuteHandLength
|
width: minuteHandLength
|
||||||
height: minuteHandWidth
|
height: minuteHandWidth
|
||||||
radius: minuteHandWidth / 2
|
radius: minuteHandWidth / 2
|
||||||
color: Appearance.colors.colSecondary
|
color: root.colMinuteHand
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Center dot
|
// Center dot
|
||||||
Rectangle {
|
Rectangle {
|
||||||
z: 4
|
z: 4
|
||||||
color: Appearance.colors.colOnPrimary
|
color: root.colOnHourHand
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
implicitWidth: centerDotSize
|
implicitWidth: centerDotSize
|
||||||
implicitHeight: implicitWidth
|
implicitHeight: implicitWidth
|
||||||
|
|||||||
Reference in New Issue
Block a user