Skip to content

Commit c0af863

Browse files
committed
chore: fixed 2 methods of "if/else" to just one, also fixed the Style singleton issue where root could never be accessed.
1 parent 1ff0cc1 commit c0af863

1 file changed

Lines changed: 10 additions & 10 deletions

File tree

modern-clock/DesktopWidget.qml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ DraggableDesktopWidget {
1616
readonly property bool colourChoice: widgetData?.colourChoice ?? true
1717

1818
readonly property color dayColour: colourChoice
19-
? Color.resolveColorKey(widgetData?.dayColourChoice ?? "error")
19+
? Color.resolveColorKey(widgetData?.dayColourChoice ?? "secondary")
2020
: (widgetData?.dayColourPicker ?? "black")
2121

2222
readonly property color dateColour: colourChoice
@@ -28,15 +28,15 @@ DraggableDesktopWidget {
2828
: (widgetData?.timeColourPicker ?? "black")
2929

3030
// Font
31-
readonly property string customDayFont: widgetData?.customDayFont ?? Style.fontFamily ?? root.customFont ?? ""
32-
readonly property string customDateFont: widgetData?.customDateFont ?? Style.fontFamily ?? root.customFont ?? ""
33-
readonly property string customTimeFont: widgetData?.customTimeFont ?? Style.fontFamily ?? root.customFont ?? ""
34-
35-
readonly property real dayFontSize: widgetData?.dayFontSize !== undefined ? widgetData?.dayFontSize : 1.0
36-
readonly property real dateFontSize: widgetData?.dateFontSize !== undefined ? widgetData?.dateFontSize : 1.0
37-
readonly property real timeFontSize: widgetData?.timeFontSize !== undefined ? widgetData?.timeFontSize : 1.0
38-
39-
readonly property real textOpacity: widgetData?.textOpacity !== undefined ? widgetData?.textOpacity : 1.0
31+
readonly property string customDayFont: widgetData?.customDayFont ?? root.customFont ?? Style.fontFamily
32+
readonly property string customDateFont: widgetData?.customDateFont ?? root.customFont ?? Style.fontFamily
33+
readonly property string customTimeFont: widgetData?.customTimeFont ?? root.customFont ?? Style.fontFamily
34+
?? root.customFont
35+
readonly property real dayFontSize: widgetData?.dayFontSize ?? 1.0
36+
readonly property real dateFontSize: widgetData?.dateFontSize ?? 1.0
37+
readonly property real timeFontSize: widgetData?.timeFontSize ?? 1.0
38+
39+
readonly property real textOpacity: widgetData?.textOpacity ?? 1.0
4040
readonly property real contentPadding: Math.round(Style.marginL * widgetScale)
4141

4242
// Width = Max(FontWidth) + padding

0 commit comments

Comments
 (0)