mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-04-26 14:23:09 +00:00
Apply settings 12/24 hour time format to lockscreen and panel time
This commit is contained in:
parent
a857dbc299
commit
cd4bf8d7c3
4 changed files with 7 additions and 3 deletions
|
|
@ -217,8 +217,10 @@ Item {
|
|||
|
||||
PlasmaComponents.Label {
|
||||
id: clock
|
||||
property bool is24HourTime: Qt.locale().timeFormat(Locale.ShortFormat).toLowerCase().indexOf("ap") === -1
|
||||
|
||||
anchors.fill: parent
|
||||
text: Qt.formatTime(timeSource.data.Local.DateTime, "hh:mm")
|
||||
text: Qt.formatTime(timeSource.data.Local.DateTime, is24HourTime ? "h:mm" : "h:mm ap")
|
||||
color: PlasmaCore.ColorScope.textColor
|
||||
horizontalAlignment: Qt.AlignHCenter
|
||||
verticalAlignment: Qt.AlignVCenter
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ ColumnLayout {
|
|||
spacing: units.gridUnit
|
||||
|
||||
Label {
|
||||
text: Qt.formatTime(timeSource.data["Local"]["DateTime"], "h:mm ap")
|
||||
text: Qt.formatTime(timeSource.data["Local"]["DateTime"], root.is24HourTime ? "h:mm" : "h:mm ap")
|
||||
color: ColorScope.textColor
|
||||
style: softwareRendering ? Text.Outline : Text.Normal
|
||||
styleColor: softwareRendering ? ColorScope.backgroundColor : "transparent" // no outline, doesn't matter
|
||||
|
|
|
|||
|
|
@ -33,6 +33,8 @@ PlasmaCore.ColorScope {
|
|||
property bool isWidescreen: root.height < root.width * 0.75
|
||||
property bool notificationsShown: phoneNotificationsList.count !== 0
|
||||
|
||||
property bool is24HourTime: Qt.locale().timeFormat(Locale.ShortFormat).toLowerCase().indexOf("ap") === -1
|
||||
|
||||
colorGroup: PlasmaCore.Theme.ComplementaryColorGroup
|
||||
anchors.fill: parent
|
||||
|
||||
|
|
|
|||
|
|
@ -76,7 +76,7 @@ PlasmaCore.ColorScope {
|
|||
PlasmaComponents.Label {
|
||||
id: clock
|
||||
anchors.fill: parent
|
||||
text: Qt.formatTime(timeSource.data.Local.DateTime, "hh:mm")
|
||||
text: Qt.formatTime(timeSource.data.Local.DateTime, root.is24HourTime ? "h:mm" : "h:mm ap")
|
||||
color: PlasmaCore.ColorScope.textColor
|
||||
horizontalAlignment: Qt.AlignHCenter
|
||||
verticalAlignment: Qt.AlignVCenter
|
||||
|
|
|
|||
Loading…
Reference in a new issue