fix: improve clock (again)
This commit is contained in:
parent
1efb0be5ae
commit
6b79abf330
1 changed files with 10 additions and 4 deletions
|
|
@ -57,7 +57,10 @@ StyledRect {
|
||||||
StyledText {
|
StyledText {
|
||||||
Layout.alignment: Qt.AlignHCenter
|
Layout.alignment: Qt.AlignHCenter
|
||||||
text: Time.hourStr
|
text: Time.hourStr
|
||||||
font: root.font.width(Math.min(120, Math.max(hourMetrics.width, minMetrics.width) / hourMetrics.width * 100)).build()
|
font: {
|
||||||
|
const scale = text === "11" ? 1.15 : Math.min(1.05, Math.max(hourMetrics.width, minMetrics.width) / hourMetrics.width);
|
||||||
|
return root.font.width(scale * 100).letterSpacing(scale).build();
|
||||||
|
}
|
||||||
color: root.colour
|
color: root.colour
|
||||||
|
|
||||||
TextMetrics {
|
TextMetrics {
|
||||||
|
|
@ -69,10 +72,13 @@ StyledRect {
|
||||||
}
|
}
|
||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
Layout.topMargin: -parent.spacing - 2
|
Layout.topMargin: -parent.spacing - 4
|
||||||
Layout.alignment: Qt.AlignHCenter
|
Layout.alignment: Qt.AlignHCenter
|
||||||
text: Time.minuteStr
|
text: Time.minuteStr
|
||||||
font: root.font.width(Math.min(120, Math.max(hourMetrics.width, minMetrics.width) / minMetrics.width * 100)).build()
|
font: {
|
||||||
|
const scale = text === "11" ? 1.15 : Math.min(1.05, Math.max(hourMetrics.width, minMetrics.width) / minMetrics.width);
|
||||||
|
return root.font.width(scale * 100).letterSpacing(scale).build();
|
||||||
|
}
|
||||||
color: root.colour
|
color: root.colour
|
||||||
|
|
||||||
TextMetrics {
|
TextMetrics {
|
||||||
|
|
@ -84,7 +90,7 @@ StyledRect {
|
||||||
}
|
}
|
||||||
|
|
||||||
Loader {
|
Loader {
|
||||||
Layout.topMargin: -parent.spacing - 1
|
Layout.topMargin: -parent.spacing - 4
|
||||||
Layout.alignment: Qt.AlignHCenter
|
Layout.alignment: Qt.AlignHCenter
|
||||||
asynchronous: true
|
asynchronous: true
|
||||||
active: GlobalConfig.services.useTwelveHourClock
|
active: GlobalConfig.services.useTwelveHourClock
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue