summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--modules/lock/Center.qml15
-rw-r--r--modules/lock/Fetch.qml24
-rw-r--r--modules/lock/WeatherInfo.qml19
3 files changed, 40 insertions, 18 deletions
diff --git a/modules/lock/Center.qml b/modules/lock/Center.qml
index 45c14e0..005a13c 100644
--- a/modules/lock/Center.qml
+++ b/modules/lock/Center.qml
@@ -13,7 +13,8 @@ ColumnLayout {
required property var lock
readonly property list<string> timeComponents: Time.format(Config.services.useTwelveHourClock ? "hh:mm:A" : "hh:mm").split(":")
- readonly property int centerWidth: Config.lock.sizes.centerWidth * Math.min(1, lock.screen.height / 1440)
+ readonly property real centerScale: Math.min(1, (lock.screen?.height ?? 1440) / 1440)
+ readonly property int centerWidth: Config.lock.sizes.centerWidth * centerScale
Layout.preferredWidth: centerWidth
Layout.fillHeight: true
@@ -28,7 +29,7 @@ ColumnLayout {
Layout.alignment: Qt.AlignVCenter
text: root.timeComponents[0]
color: Colours.palette.m3secondary
- font.pointSize: Appearance.font.size.extraLarge * 3
+ font.pointSize: Appearance.font.size.extraLarge * 3 * root.centerScale
font.bold: true
}
@@ -36,7 +37,7 @@ ColumnLayout {
Layout.alignment: Qt.AlignVCenter
text: ":"
color: Colours.palette.m3primary
- font.pointSize: Appearance.font.size.extraLarge * 3
+ font.pointSize: Appearance.font.size.extraLarge * 3 * root.centerScale
font.bold: true
}
@@ -44,7 +45,7 @@ ColumnLayout {
Layout.alignment: Qt.AlignVCenter
text: root.timeComponents[1]
color: Colours.palette.m3secondary
- font.pointSize: Appearance.font.size.extraLarge * 3
+ font.pointSize: Appearance.font.size.extraLarge * 3 * root.centerScale
font.bold: true
}
@@ -59,7 +60,7 @@ ColumnLayout {
sourceComponent: StyledText {
text: root.timeComponents[2] ?? ""
color: Colours.palette.m3primary
- font.pointSize: Appearance.font.size.extraLarge * 2
+ font.pointSize: Appearance.font.size.extraLarge * 2 * root.centerScale
font.bold: true
}
}
@@ -71,7 +72,7 @@ ColumnLayout {
text: Time.format("dddd, d MMMM yyyy")
color: Colours.palette.m3tertiary
- font.pointSize: Appearance.font.size.extraLarge
+ font.pointSize: Appearance.font.size.extraLarge * root.centerScale
font.family: Appearance.font.family.mono
font.bold: true
}
@@ -92,7 +93,7 @@ ColumnLayout {
text: "person"
fill: 1
grade: 200
- font.pointSize: Math.floor(root.centerWidth / 4) || 1
+ font.pointSize: Math.floor(root.centerWidth / 4)
}
CachingImage {
diff --git a/modules/lock/Fetch.qml b/modules/lock/Fetch.qml
index 755e7f8..815807b 100644
--- a/modules/lock/Fetch.qml
+++ b/modules/lock/Fetch.qml
@@ -87,12 +87,26 @@ ColumnLayout {
Layout.leftMargin: iconLoader.active ? 0 : width * 0.1
spacing: Appearance.spacing.normal
- FetchText {
- text: `OS : ${SysInfo.osPrettyName || SysInfo.osName}`
+ Loader {
+ Layout.fillWidth: true
+ asynchronous: true
+ active: root.height > 200
+ visible: active
+
+ sourceComponent: FetchText {
+ text: `OS : ${SysInfo.osPrettyName || SysInfo.osName}`
+ }
}
- FetchText {
- text: `WM : ${SysInfo.wm}`
+ Loader {
+ Layout.fillWidth: true
+ asynchronous: true
+ active: root.height > 110
+ visible: active
+
+ sourceComponent: FetchText {
+ text: `WM : ${SysInfo.wm}`
+ }
}
FetchText {
@@ -109,7 +123,7 @@ ColumnLayout {
Layout.alignment: Qt.AlignHCenter
asynchronous: true
- active: root.height > 220
+ active: root.height > 180
visible: active
sourceComponent: RowLayout {
diff --git a/modules/lock/WeatherInfo.qml b/modules/lock/WeatherInfo.qml
index 3695061..9da0b9b 100644
--- a/modules/lock/WeatherInfo.qml
+++ b/modules/lock/WeatherInfo.qml
@@ -18,17 +18,24 @@ ColumnLayout {
spacing: Appearance.spacing.small
- StyledText {
+ Loader {
Layout.topMargin: Appearance.padding.large * 2
+ Layout.bottomMargin: -Appearance.padding.large
Layout.alignment: Qt.AlignHCenter
- text: qsTr("Weather")
- color: Colours.palette.m3primary
- font.pointSize: Appearance.font.size.extraLarge
- font.weight: 500
+
+ asynchronous: true
+ active: root.rootHeight > 610
+ visible: active
+
+ sourceComponent: StyledText {
+ text: qsTr("Weather")
+ color: Colours.palette.m3primary
+ font.pointSize: Appearance.font.size.extraLarge
+ font.weight: 500
+ }
}
RowLayout {
- Layout.bottomMargin: forecastLoader.active ? 0 : Appearance.padding.large
Layout.fillWidth: true
spacing: Appearance.spacing.large