1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-08-04 20:48:29 -04:00

time: add follow-locale option and squash separate greeter time options

port 1.5
This commit is contained in:
bbedward
2026-07-13 08:53:09 -04:00
parent 8a0ed8a50f
commit f4f47c0bc5
6 changed files with 72 additions and 134 deletions
@@ -547,42 +547,6 @@ Item {
onFontSelected: family => SettingsData.set("greeterFontFamily", family)
}
StyledText {
text: I18n.tr("Time Format")
font.pixelSize: Theme.fontSizeMedium
font.weight: Font.Medium
color: Theme.surfaceText
topPadding: Theme.spacingM
width: parent.width
horizontalAlignment: Text.AlignLeft
}
SettingsToggleRow {
settingKey: "greeterUse24Hour"
tags: ["greeter", "time", "24hour"]
text: I18n.tr("24-hour clock")
description: I18n.tr("Greeter only — does not affect main clock")
checked: SettingsData.greeterUse24HourClock
onToggled: checked => SettingsData.set("greeterUse24HourClock", checked)
}
SettingsToggleRow {
settingKey: "greeterShowSeconds"
tags: ["greeter", "time", "seconds"]
text: I18n.tr("Show Seconds")
checked: SettingsData.greeterShowSeconds
onToggled: checked => SettingsData.set("greeterShowSeconds", checked)
}
SettingsToggleRow {
settingKey: "greeterPadHours"
tags: ["greeter", "time", "12hour"]
text: I18n.tr("Pad hours (02:00 vs 2:00)")
visible: !SettingsData.greeterUse24HourClock
checked: SettingsData.greeterPadHours12Hour
onToggled: checked => SettingsData.set("greeterPadHours12Hour", checked)
}
StyledText {
text: I18n.tr("Date format on greeter")
font.pixelSize: Theme.fontSizeMedium
+29 -6
View File
@@ -46,14 +46,37 @@ Item {
settingKey: "timeFormat"
iconName: "schedule"
SettingsToggleRow {
SettingsDropdownRow {
tab: "time"
tags: ["time", "24hour", "format"]
settingKey: "use24HourClock"
text: I18n.tr("24-Hour Format")
tags: ["time", "24hour", "12hour", "format", "locale"]
settingKey: "clockFormat"
text: I18n.tr("Time Format")
description: I18n.tr("Use 24-hour time format instead of 12-hour AM/PM")
checked: SettingsData.use24HourClock
onToggled: checked => SettingsData.set("use24HourClock", checked)
readonly property var _sample: new Date(2000, 0, 1, 13, 0, 0)
readonly property string _twelve: Qt.formatTime(_sample, "h:mm AP")
readonly property string _twentyFour: Qt.formatTime(_sample, "HH:mm")
options: [I18n.tr("System Default"), _twelve, _twentyFour]
currentValue: {
switch (SettingsData.clockFormat) {
case "12h":
return _twelve;
case "24h":
return _twentyFour;
default:
return I18n.tr("System Default");
}
}
onValueChanged: value => {
if (value === _twelve) {
SettingsData.set("clockFormat", "12h");
return;
}
if (value === _twentyFour) {
SettingsData.set("clockFormat", "24h");
return;
}
SettingsData.set("clockFormat", "auto");
}
}
SettingsToggleRow {