diff options
| author | Laurens Duin <85798751+Laurens256@users.noreply.github.com> | 2025-07-31 12:41:56 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-07-31 20:41:56 +1000 |
| commit | 7edcae651e1124c1437be93594c3aebf64090372 (patch) | |
| tree | 6f9f8c34ef34228d40c15b596ad1dfa23cc674d4 /modules/lock/Clock.qml | |
| parent | config: allow configuring external audio program (diff) | |
| download | caelestia-shell-7edcae651e1124c1437be93594c3aebf64090372.tar.gz caelestia-shell-7edcae651e1124c1437be93594c3aebf64090372.tar.bz2 caelestia-shell-7edcae651e1124c1437be93594c3aebf64090372.zip | |
config: respect user locale for twelve hour clock & temperature (#290)
* bar: add 12h clock option
* feat: allow custom format config
* feat: 12h clock based on locale with config
* chore: cleanup
* fix: PR comments, add automatic fahrenheit
* fix: formatting
* dashboard: fix up date time
* lock: better 12h clock
---------
Co-authored-by: Soramane <61896496+soramanew@users.noreply.github.com>
Diffstat (limited to 'modules/lock/Clock.qml')
| -rw-r--r-- | modules/lock/Clock.qml | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/modules/lock/Clock.qml b/modules/lock/Clock.qml index 43d7d4d..888c877 100644 --- a/modules/lock/Clock.qml +++ b/modules/lock/Clock.qml @@ -1,6 +1,7 @@ import qs.widgets import qs.services import qs.config +import QtQuick import QtQuick.Layouts ColumnLayout { @@ -8,13 +9,15 @@ ColumnLayout { spacing: 0 + readonly property list<string> timeComponents: Time.format(Config.services.useTwelveHourClock ? "hh:mm:A" : "hh:mm").split(":") + RowLayout { Layout.alignment: Qt.AlignHCenter spacing: Appearance.spacing.small StyledText { Layout.alignment: Qt.AlignVCenter - text: Time.format("HH") + text: root.timeComponents[0] color: Colours.palette.m3secondary font.pointSize: Appearance.font.size.extraLarge * 4 font.family: Appearance.font.family.mono @@ -32,12 +35,23 @@ ColumnLayout { StyledText { Layout.alignment: Qt.AlignVCenter - text: Time.format("mm") + text: root.timeComponents[1] color: Colours.palette.m3secondary font.pointSize: Appearance.font.size.extraLarge * 4 font.family: Appearance.font.family.mono font.weight: 800 } + + StyledText { + visible: Config.services.useTwelveHourClock + Layout.leftMargin: Appearance.spacing.normal + Layout.alignment: Qt.AlignVCenter + + text: root.timeComponents[2] + color: Colours.palette.m3primary + font.pointSize: Appearance.font.size.extraLarge * 3 + font.weight: 700 + } } StyledText { |