forked from Shinonome/dots-hyprland
added simpler cookie clock style
This commit is contained in:
@@ -332,7 +332,7 @@ Variants {
|
|||||||
|
|
||||||
Loader {
|
Loader {
|
||||||
id: cookieClockLoader
|
id: cookieClockLoader
|
||||||
visible: root.clockStyle === "cookie"
|
visible: root.clockStyle === "cookie" || root.clockStyle === "simpler-cookie"
|
||||||
active: visible
|
active: visible
|
||||||
sourceComponent: CookieClock {}
|
sourceComponent: CookieClock {}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,11 +13,13 @@ import Qt5Compat.GraphicalEffects
|
|||||||
Item {
|
Item {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
|
readonly property string clockStyle: Config.options.background.clock.style
|
||||||
|
|
||||||
property real implicitSize: 230
|
property real implicitSize: 230
|
||||||
property real hourHandLength: 72
|
property real hourHandLength: 72
|
||||||
property real hourHandWidth: 16
|
property real hourHandWidth: 20
|
||||||
property real minuteHandLength: 95
|
property real minuteHandLength: 95
|
||||||
property real minuteHandWidth: 8
|
property real minuteHandWidth: clockStyle === "simpler-cookie" ? hourHandWidth : 12
|
||||||
property real centerDotSize: 10
|
property real centerDotSize: 10
|
||||||
property real hourDotSize: minuteHandWidth
|
property real hourDotSize: minuteHandWidth
|
||||||
|
|
||||||
@@ -31,6 +33,7 @@ Item {
|
|||||||
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
|
||||||
readonly property int clockMinute: parseInt(clockNumbers[1])
|
readonly property int clockMinute: parseInt(clockNumbers[1])
|
||||||
|
|
||||||
implicitWidth: implicitSize
|
implicitWidth: implicitSize
|
||||||
implicitHeight: implicitSize
|
implicitHeight: implicitSize
|
||||||
|
|
||||||
@@ -50,13 +53,15 @@ Item {
|
|||||||
z: 0
|
z: 0
|
||||||
implicitSize: root.implicitSize
|
implicitSize: root.implicitSize
|
||||||
amplitude: implicitSize / 70
|
amplitude: implicitSize / 70
|
||||||
sides: 12
|
sides: Config.options.background.clock.clockSides
|
||||||
color: root.colBackground
|
color: root.colBackground
|
||||||
|
|
||||||
// 12 dots around the cookie
|
// 12 dots around the cookie
|
||||||
Repeater {
|
Repeater {
|
||||||
|
|
||||||
model: 12
|
model: 12
|
||||||
Item {
|
Item {
|
||||||
|
visible: clockStyle === "simpler-cookie" ? false : true
|
||||||
required property int index
|
required property int index
|
||||||
rotation: 360 / 12 * index
|
rotation: 360 / 12 * index
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
@@ -81,6 +86,7 @@ Item {
|
|||||||
z: 1
|
z: 1
|
||||||
anchors.centerIn: cookie
|
anchors.centerIn: cookie
|
||||||
spacing: -16
|
spacing: -16
|
||||||
|
visible: false // LOOK
|
||||||
|
|
||||||
// Numbers
|
// Numbers
|
||||||
Repeater {
|
Repeater {
|
||||||
@@ -132,6 +138,7 @@ Item {
|
|||||||
|
|
||||||
// Center dot
|
// Center dot
|
||||||
Rectangle {
|
Rectangle {
|
||||||
|
visible: clockStyle === "simpler-cookie" ? false : true
|
||||||
z: 4
|
z: 4
|
||||||
color: root.colOnHourHand
|
color: root.colOnHourHand
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
|
|||||||
@@ -127,8 +127,9 @@ Singleton {
|
|||||||
property real x: -500
|
property real x: -500
|
||||||
property real y: -500
|
property real y: -500
|
||||||
property bool show: true
|
property bool show: true
|
||||||
property string style: "cookie" // Options: "cookie", "digital"
|
property string style: "cookie" // Options: "cookie", "digital", "simpler-cookie"
|
||||||
property real scale: 1
|
property real scale: 1
|
||||||
|
property int clockSides: 12
|
||||||
}
|
}
|
||||||
property string wallpaperPath: ""
|
property string wallpaperPath: ""
|
||||||
property string thumbnailPath: ""
|
property string thumbnailPath: ""
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ ContentPage {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
ConfigSpinBox {
|
ConfigSpinBox {
|
||||||
text: Translation.tr("Scale (%)")
|
text: Translation.tr("Scale (%)")
|
||||||
value: Config.options.background.clock.scale * 100
|
value: Config.options.background.clock.scale * 100
|
||||||
@@ -31,6 +32,17 @@ ContentPage {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ConfigSpinBox {
|
||||||
|
text: Translation.tr("Clock sides")
|
||||||
|
value: Config.options.background.clock.clockSides
|
||||||
|
from: 1
|
||||||
|
to: 36
|
||||||
|
stepSize: 1
|
||||||
|
onValueChanged: {
|
||||||
|
Config.options.background.clock.clockSides = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ContentSubsection {
|
ContentSubsection {
|
||||||
title: Translation.tr("Clock style")
|
title: Translation.tr("Clock style")
|
||||||
ConfigSelectionArray {
|
ConfigSelectionArray {
|
||||||
@@ -49,6 +61,11 @@ ContentPage {
|
|||||||
icon: "cookie",
|
icon: "cookie",
|
||||||
value: "cookie"
|
value: "cookie"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
displayName: Translation.tr("Material simpler cookie"),
|
||||||
|
icon: "cookie",
|
||||||
|
value: "simpler-cookie"
|
||||||
|
},
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user