1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-08-06 13:38:28 -04:00

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

port 1.5

(cherry picked from commit f4f47c0bc5)
This commit is contained in:
bbedward
2026-07-13 08:53:09 -04:00
committed by dms-ci[bot]
parent c0134c249a
commit 58530ae56c
6 changed files with 72 additions and 134 deletions
+11 -4
View File
@@ -190,7 +190,12 @@ Singleton {
property int firstDayOfWeek: -1
property bool showWeekNumber: false
property string calendarBackend: "auto"
property bool use24HourClock: true
property string clockFormat: "auto"
readonly property bool localeUses24Hour: {
const fmt = Qt.locale().timeFormat(Locale.ShortFormat).replace(/'[^']*'/g, "");
return !/[aA]/.test(fmt);
}
readonly property bool use24HourClock: clockFormat === "24h" ? true : (clockFormat === "12h" ? false : localeUses24Hour)
property bool showSeconds: false
property bool padHours12Hour: false
property bool useFahrenheit: false
@@ -492,9 +497,6 @@ Singleton {
property bool greeterEnableFprint: false
property bool greeterEnableU2f: false
property string greeterWallpaperPath: ""
property bool greeterUse24HourClock: true
property bool greeterShowSeconds: false
property bool greeterPadHours12Hour: false
property string greeterLockDateFormat: ""
property string greeterFontFamily: ""
property string greeterWallpaperFillMode: ""
@@ -1752,6 +1754,11 @@ Singleton {
delete obj.lockScreenActiveMonitor;
}
if (obj?.use24HourClock !== undefined && obj?.clockFormat === undefined) {
obj.clockFormat = obj.use24HourClock ? "24h" : "12h";
delete obj.use24HourClock;
}
Store.parse(root, obj);
if (obj?.directionalAnimationMode === 3 && frameMode !== "connected")