diff options
| author | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-08-12 17:24:39 +1000 |
|---|---|---|
| committer | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-08-12 17:24:39 +1000 |
| commit | ab531a83b700788440d02ca0c3026bb05612515e (patch) | |
| tree | c04cb9f7ea46d22764c56d51043550e9c5a1b36c /modules/lock/Center.qml | |
| parent | lock: better scaling + fix null error (diff) | |
| download | caelestia-shell-ab531a83b700788440d02ca0c3026bb05612515e.tar.gz caelestia-shell-ab531a83b700788440d02ca0c3026bb05612515e.tar.bz2 caelestia-shell-ab531a83b700788440d02ca0c3026bb05612515e.zip | |
lock: better scaling
Diffstat (limited to 'modules/lock/Center.qml')
| -rw-r--r-- | modules/lock/Center.qml | 15 |
1 files changed, 8 insertions, 7 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 { |