mirror of
https://github.com/developersu/ClearClock.git
synced 2025-05-14 19:20:26 +03:00
Merge branch 'qewer33:main' into main
This commit is contained in:
commit
48d0e1ba05
4 changed files with 26 additions and 6 deletions
Binary file not shown.
|
@ -9,9 +9,13 @@
|
|||
|
||||
<!-- Clock Display Settings -->
|
||||
<entry name="clockUse24hFormat" type="Bool">
|
||||
<label>Force the clock to use 12/24 hour time, instead of following the user locale.</label>
|
||||
<label>Forces the clock to use 12/24 hour time, instead of following the user locale.</label>
|
||||
<default>true</default>
|
||||
</entry>
|
||||
<entry name="clockShowSeconds" type="Bool">
|
||||
<label>Makes the clock show seconds after minutes.</label>
|
||||
<default>false</default>
|
||||
</entry>
|
||||
<entry name="clockSeparator" type="string">
|
||||
<label>Sets the clock separator.</label>
|
||||
<default>.</default>
|
||||
|
|
|
@ -20,6 +20,7 @@ Item {
|
|||
signal configurationChanged
|
||||
|
||||
property alias cfg_clockUse24hFormat: use24hFormat.checkState
|
||||
property alias cfg_clockShowSeconds: showSeconds.checkState
|
||||
property alias cfg_clockSeparator: clockSeparatorTextField.text
|
||||
property string cfg_clockFontColor
|
||||
property string cfg_clockFontFamily
|
||||
|
@ -128,6 +129,13 @@ Item {
|
|||
checked: cfg_clockUse24hFormat
|
||||
}
|
||||
|
||||
QtControls.CheckBox {
|
||||
id: showSeconds
|
||||
text: i18n("Show seconds")
|
||||
tristate: false
|
||||
checked: cfg_clockShowSeconds
|
||||
}
|
||||
|
||||
QtLayouts.RowLayout {
|
||||
QtControls.Label {
|
||||
text: i18n("Separator:")
|
||||
|
|
|
@ -24,8 +24,8 @@ Item {
|
|||
id: dataSource
|
||||
engine: "time"
|
||||
connectedSources: ["Local"]
|
||||
interval: 60000
|
||||
intervalAlignment: PlasmaCore.Types.AlignToMinute
|
||||
interval: plasmoid.configuration.clockShowSeconds ? 1000 : 60000
|
||||
intervalAlignment: plasmoid.configuration.clockShowSeconds ? PlasmaCore.Types.NoAlignment : PlasmaCore.Types.AlignToMinute
|
||||
}
|
||||
|
||||
FontLoader {
|
||||
|
@ -52,7 +52,8 @@ Item {
|
|||
font.family: clockLabel.font.family
|
||||
font.pixelSize: clockLabel.font.pixelSize
|
||||
font.bold: clockLabel.font.bold
|
||||
text: " 99:99 "
|
||||
text: if (!plasmoid.configuration.clockShowSeconds) " 99:99 "
|
||||
else " 99:99:99 "
|
||||
}
|
||||
|
||||
TextMetrics {
|
||||
|
@ -72,8 +73,15 @@ Item {
|
|||
id: clockLabel
|
||||
anchors.centerIn: parent
|
||||
|
||||
text: if (plasmoid.configuration.clockUse24hFormat) Qt.formatTime(currentDateTime, "hh.mm").replace(".", plasmoid.configuration.clockSeparator)
|
||||
else Qt.formatTime(currentDateTime, "hh.mm AP").replace(".", plasmoid.configuration.clockSeparator)
|
||||
property var textFormat: {
|
||||
var AMPM = plasmoid.configuration.clockUse24hFormat ? "" : " AP"
|
||||
if (plasmoid.configuration.clockShowSeconds)
|
||||
return Qt.formatTime(currentDateTime, "hh.mm.ss" + AMPM).replace(".", plasmoid.configuration.clockSeparator)
|
||||
else
|
||||
return Qt.formatTime(currentDateTime, "hh.mm" + AMPM).replace(".", plasmoid.configuration.clockSeparator)
|
||||
}
|
||||
|
||||
text: textFormat
|
||||
|
||||
color: plasmoid.configuration.clockFontColor
|
||||
font.family: if (plasmoid.configuration.clockFontFamily === "ccdefault") fontOutfitBold.name
|
||||
|
|
Loading…
Reference in a new issue