forked from Shinonome/dots-hyprland
add second precision option to settings, make cookie clock use DateTime.clock
This commit is contained in:
@@ -42,23 +42,8 @@ Item {
|
|||||||
property color colSeconds: Appearance.colors.colTertiary
|
property color colSeconds: Appearance.colors.colTertiary
|
||||||
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: DateTime.clock.minutes
|
||||||
|
readonly property int clockSecond: DateTime.clock.seconds
|
||||||
property int clockSecond: 0
|
|
||||||
|
|
||||||
// Loader to set root.clockSecond
|
|
||||||
Loader{
|
|
||||||
active: Config.option.background.clock.cookie.secondDot
|
|
||||||
sourceComponent: Timer {
|
|
||||||
interval: 1000
|
|
||||||
running: true;repeat: true
|
|
||||||
onTriggered: {
|
|
||||||
var now = new Date()
|
|
||||||
clockSecond = now.getSeconds()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
implicitWidth: implicitSize
|
implicitWidth: implicitSize
|
||||||
|
|||||||
@@ -210,6 +210,18 @@ ContentPage {
|
|||||||
icon: "nest_clock_farsight_analog"
|
icon: "nest_clock_farsight_analog"
|
||||||
title: Translation.tr("Time")
|
title: Translation.tr("Time")
|
||||||
|
|
||||||
|
ConfigSwitch {
|
||||||
|
buttonIcon: "pace"
|
||||||
|
text: Translation.tr("Second precision")
|
||||||
|
checked: Config.options.time.secondPrecision
|
||||||
|
onCheckedChanged: {
|
||||||
|
Config.options.time.secondPrecision = checked;
|
||||||
|
}
|
||||||
|
StyledToolTip {
|
||||||
|
text: Translation.tr("Enable if you want clocks to show seconds accurately")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ContentSubsection {
|
ContentSubsection {
|
||||||
title: Translation.tr("Format")
|
title: Translation.tr("Format")
|
||||||
tooltip: ""
|
tooltip: ""
|
||||||
|
|||||||
Reference in New Issue
Block a user