mirror of
https://github.com/developersu/ClearClock.git
synced 2025-05-15 03:30:26 +03:00
Fix custom date format config
This commit is contained in:
parent
8c7a876674
commit
aced0d6a84
6 changed files with 21 additions and 21 deletions
0
ClearClock.files
Normal file
0
ClearClock.files
Normal file
1
ClearClock.includes
Normal file
1
ClearClock.includes
Normal file
|
@ -0,0 +1 @@
|
|||
package
|
1
build.sh
Normal file
1
build.sh
Normal file
|
@ -0,0 +1 @@
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
</entry>
|
||||
<entry name="clockFontFamily" type="string">
|
||||
<label>Sets the clock font family.</label>
|
||||
<default></default>
|
||||
<default>ClearClock Default</default>
|
||||
</entry>
|
||||
<entry name="clockBoldText" type="Bool">
|
||||
<label>Sets the clock font to bold.</label>
|
||||
|
@ -42,7 +42,7 @@
|
|||
</entry>
|
||||
<entry name="dayFontFamily" type="string">
|
||||
<label>Sets the day font family.</label>
|
||||
<default></default>
|
||||
<default>ClearClock Default</default>
|
||||
</entry>
|
||||
<entry name="dayBoldText" type="Bool">
|
||||
<label>Sets the day font to bold.</label>
|
||||
|
@ -61,7 +61,7 @@
|
|||
<label>Whether the date should be shown below the clock.</label>
|
||||
<default>true</default>
|
||||
</entry>
|
||||
<entry name="customDateFormat" type="string">
|
||||
<entry name="dateCustomDateFormat" type="string">
|
||||
<label>Custom date format string.</label>
|
||||
<default>d MMMM yyyy</default>
|
||||
</entry>
|
||||
|
@ -71,7 +71,7 @@
|
|||
</entry>
|
||||
<entry name="dateFontFamily" type="string">
|
||||
<label>Sets the date font family.</label>
|
||||
<default></default>
|
||||
<default>ClearClock Default</default>
|
||||
</entry>
|
||||
<entry name="dateBoldText" type="Bool">
|
||||
<label>Sets the date font to bold.</label>
|
||||
|
|
|
@ -66,6 +66,10 @@ Item {
|
|||
id: fontsModel
|
||||
Component.onCompleted: {
|
||||
var arr = [] // use temp array to avoid constant binding stuff
|
||||
arr.push({
|
||||
"text": "ClearClock Default",
|
||||
"value": "ClearClock Default"
|
||||
})
|
||||
arr.push({
|
||||
"text": i18nc("Use default font", "Default"),
|
||||
"value": ""
|
||||
|
@ -139,10 +143,8 @@ Item {
|
|||
QtControls.ComboBox {
|
||||
id: clockFontFamilyComboBox
|
||||
QtLayouts.Layout.fillWidth: true
|
||||
// ComboBox's sizing is just utterly broken
|
||||
QtLayouts.Layout.minimumWidth: units.gridUnit * 10
|
||||
model: fontsModel
|
||||
// doesn't autodeduce from model because we manually populate it
|
||||
textRole: "text"
|
||||
|
||||
onCurrentIndexChanged: {
|
||||
|
@ -239,10 +241,8 @@ Item {
|
|||
QtControls.ComboBox {
|
||||
id: dayFontFamilyComboBox
|
||||
QtLayouts.Layout.fillWidth: true
|
||||
// ComboBox's sizing is just utterly broken
|
||||
QtLayouts.Layout.minimumWidth: units.gridUnit * 10
|
||||
model: fontsModel
|
||||
// doesn't autodeduce from model because we manually populate it
|
||||
textRole: "text"
|
||||
|
||||
onCurrentIndexChanged: {
|
||||
|
@ -363,10 +363,8 @@ Item {
|
|||
QtControls.ComboBox {
|
||||
id: dateFontFamilyComboBox
|
||||
QtLayouts.Layout.fillWidth: true
|
||||
// ComboBox's sizing is just utterly broken
|
||||
QtLayouts.Layout.minimumWidth: units.gridUnit * 10
|
||||
model: fontsModel
|
||||
// doesn't autodeduce from model because we manually populate it
|
||||
textRole: "text"
|
||||
|
||||
onCurrentIndexChanged: {
|
||||
|
|
|
@ -54,10 +54,10 @@ Item {
|
|||
spacing: -20
|
||||
|
||||
TextMetrics {
|
||||
id: textMetricsTimeLabel
|
||||
font.family: timeLabel.font.family
|
||||
font.pixelSize: timeLabel.font.pixelSize
|
||||
font.bold: timeLabel.font.bold
|
||||
id: textMetricsClockLabel
|
||||
font.family: clockLabel.font.family
|
||||
font.pixelSize: clockLabel.font.pixelSize
|
||||
font.bold: clockLabel.font.bold
|
||||
text: " 99:99 "
|
||||
}
|
||||
|
||||
|
@ -69,18 +69,18 @@ Item {
|
|||
}
|
||||
|
||||
Item {
|
||||
width: max(textMetricsTimeLabel.width, textMetricsDayLabel.width)
|
||||
height: max(textMetricsTimeLabel.height, textMetricsDayLabel.height)
|
||||
width: max(textMetricsClockLabel.width, textMetricsDayLabel.width)
|
||||
height: max(textMetricsClockLabel.height, textMetricsDayLabel.height)
|
||||
Layout.alignment: Qt.AlignCenter
|
||||
|
||||
PlasmaComponents.Label {
|
||||
id: timeLabel
|
||||
id: clockLabel
|
||||
anchors.centerIn: parent
|
||||
|
||||
text: Qt.formatTime(currentDateTime).replace(":", ".")
|
||||
|
||||
color: plasmoid.configuration.clockFontColor
|
||||
font.family: if (plasmoid.configuration.clockFontFamily === "") fontOutfitBold.name
|
||||
font.family: if (plasmoid.configuration.clockFontFamily === "ClearClock Default") fontOutfitBold.name
|
||||
else plasmoid.configuration.clockFontFamily
|
||||
font.bold: plasmoid.configuration.clockBoldText
|
||||
font.italic: plasmoid.configuration.clockItalicText
|
||||
|
@ -95,7 +95,7 @@ Item {
|
|||
text: Qt.formatDate(currentDateTime, "dddd")
|
||||
|
||||
color: plasmoid.configuration.dayFontColor
|
||||
font.family: if (plasmoid.configuration.dayFontFamily === "") fontSmooch.name
|
||||
font.family: if (plasmoid.configuration.dayFontFamily === "ClearClock Default") fontSmooch.name
|
||||
else plasmoid.configuration.dayFontFamily
|
||||
font.bold: plasmoid.configuration.daykBoldText
|
||||
font.italic: plasmoid.configuration.dayItalicText
|
||||
|
@ -108,10 +108,10 @@ Item {
|
|||
visible: plasmoid.configuration.showDateDisplay
|
||||
Layout.alignment: Qt.AlignCenter
|
||||
|
||||
text: Qt.formatDate(currentDateTime, plasmoid.configuration.customDateFormat)
|
||||
text: Qt.formatDate(currentDateTime, plasmoid.configuration.dateCustomDateFormat)
|
||||
|
||||
color: plasmoid.configuration.dateFontColor
|
||||
font.family: if (plasmoid.configuration.dateFontFamily === "") fontOutfitRegular.name
|
||||
font.family: if (plasmoid.configuration.dateFontFamily === "ClearClock Default") fontOutfitRegular.name
|
||||
else plasmoid.configuration.dateFontFamily
|
||||
font.bold: plasmoid.configuration.dateBoldText
|
||||
font.italic: plasmoid.configuration.dateItalicText
|
||||
|
|
Loading…
Reference in a new issue