mirror of
https://github.com/end-4/dots-hyprland.git
synced 2026-06-05 14:59:27 -05:00
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
|
||||
readonly property list<string> clockNumbers: DateTime.time.split(/[: ]/)
|
||||
readonly property int clockHour: parseInt(clockNumbers[0]) % 12
|
||||
readonly property int clockMinute: parseInt(clockNumbers[1])
|
||||
|
||||
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()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
readonly property int clockMinute: DateTime.clock.minutes
|
||||
readonly property int clockSecond: DateTime.clock.seconds
|
||||
|
||||
|
||||
implicitWidth: implicitSize
|
||||
|
||||
@@ -210,6 +210,18 @@ ContentPage {
|
||||
icon: "nest_clock_farsight_analog"
|
||||
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 {
|
||||
title: Translation.tr("Format")
|
||||
tooltip: ""
|
||||
|
||||
Reference in New Issue
Block a user