mirror of
https://github.com/developersu/ClearClock.git
synced 2025-05-14 19:20:26 +03:00
Add option to change clock separator
This commit is contained in:
parent
c51c4f1c43
commit
feb1e5853a
3 changed files with 18 additions and 2 deletions
|
@ -11,6 +11,10 @@
|
|||
<label>Force the clock to use 12/24 hour time, instead of following the user locale.</label>
|
||||
<default>true</default>
|
||||
</entry>
|
||||
<entry name="clockSeparator" type="string">
|
||||
<label>Sets the clock separator.</label>
|
||||
<default>.</default>
|
||||
</entry>
|
||||
<entry name="clockFontColor" type="Color">
|
||||
<label>Color of text</label>
|
||||
<default>#ffffff</default>
|
||||
|
|
|
@ -20,6 +20,7 @@ Item {
|
|||
signal configurationChanged
|
||||
|
||||
property alias cfg_clockUse24hFormat: use24hFormat.checkState
|
||||
property alias cfg_clockSeparator: clockSeparatorTextField.text
|
||||
property string cfg_clockFontColor
|
||||
property string cfg_clockFontFamily
|
||||
property bool cfg_clockBoldText
|
||||
|
@ -108,6 +109,17 @@ Item {
|
|||
checked: cfg_clockUse24hFormat
|
||||
}
|
||||
|
||||
QtLayouts.RowLayout {
|
||||
QtControls.Label {
|
||||
text: i18n("Separator:")
|
||||
}
|
||||
|
||||
QtControls.TextField {
|
||||
id: clockSeparatorTextField
|
||||
maximumLength: 1
|
||||
}
|
||||
}
|
||||
|
||||
FontConfig {
|
||||
fontModel: fontsModel
|
||||
|
||||
|
|
|
@ -71,8 +71,8 @@ Item {
|
|||
id: clockLabel
|
||||
anchors.centerIn: parent
|
||||
|
||||
text: if (plasmoid.configuration.clockUse24hFormat) Qt.formatTime(currentDateTime, "hh.mm")
|
||||
else Qt.formatTime(currentDateTime, "hh.mm AP")
|
||||
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)
|
||||
|
||||
color: plasmoid.configuration.clockFontColor
|
||||
font.family: if (plasmoid.configuration.clockFontFamily === "ccdefault") fontOutfitBold.name
|
||||
|
|
Loading…
Reference in a new issue