1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-01-25 05:52:50 -05:00

support for displaying seconds on a clock (#457)

Co-authored-by: Oleksandr <avktech@gmail.com>
This commit is contained in:
Oleksandr
2025-10-16 16:51:23 +03:00
committed by GitHub
parent 9dcd8af7a3
commit ce44edb419
5 changed files with 125 additions and 7 deletions

View File

@@ -60,6 +60,7 @@ Singleton {
property real cornerRadius: 12
property bool use24HourClock: true
property bool showSeconds: false
property bool useFahrenheit: false
property bool nightModeEnabled: false
property int animationSpeed: SettingsData.AnimationSpeed.Short
@@ -320,6 +321,7 @@ Singleton {
popupTransparency = settings.popupTransparency !== undefined ? (settings.popupTransparency > 1 ? settings.popupTransparency / 100 : settings.popupTransparency) : 1.0
dockTransparency = settings.dockTransparency !== undefined ? (settings.dockTransparency > 1 ? settings.dockTransparency / 100 : settings.dockTransparency) : 1
use24HourClock = settings.use24HourClock !== undefined ? settings.use24HourClock : true
showSeconds = settings.showSeconds !== undefined ? settings.showSeconds : true
useFahrenheit = settings.useFahrenheit !== undefined ? settings.useFahrenheit : false
nightModeEnabled = settings.nightModeEnabled !== undefined ? settings.nightModeEnabled : false
weatherLocation = settings.weatherLocation !== undefined ? settings.weatherLocation : "New York, NY"
@@ -528,6 +530,7 @@ Singleton {
"popupTransparency": popupTransparency,
"dockTransparency": dockTransparency,
"use24HourClock": use24HourClock,
"showSeconds": showSeconds,
"useFahrenheit": useFahrenheit,
"nightModeEnabled": nightModeEnabled,
"weatherLocation": weatherLocation,
@@ -679,7 +682,7 @@ Singleton {
const validKeys = [
"currentThemeName", "customThemeFile", "matugenScheme", "runUserMatugenTemplates",
"dankBarTransparency", "dankBarWidgetTransparency", "popupTransparency", "dockTransparency",
"use24HourClock", "useFahrenheit", "nightModeEnabled", "weatherLocation",
"use24HourClock", "showSeconds", "useFahrenheit", "nightModeEnabled", "weatherLocation",
"weatherCoordinates", "useAutoLocation", "weatherEnabled", "showLauncherButton",
"showWorkspaceSwitcher", "showFocusedWindow", "showWeather", "showMusic",
"showClipboard", "showCpuUsage", "showMemUsage", "showCpuTemp", "showGpuTemp",
@@ -744,9 +747,9 @@ Singleton {
function getEffectiveTimeFormat() {
if (use24HourClock) {
return Locale.ShortFormat
return showSeconds ? "hh:mm:ss" : "hh:mm"
} else {
return "h:mm AP"
return showSeconds ? "h:mm:ss AP": "h:mm AP"
}
}
@@ -1020,6 +1023,11 @@ Singleton {
saveSettings()
}
function setTimeFormat(useSec) {
showSeconds = useSec
saveSettings()
}
function setTemperatureUnit(fahrenheit) {
useFahrenheit = fahrenheit
saveSettings()