lock: better scaling
This commit is contained in:
parent
68bb5dd7f9
commit
ab531a83b7
3 changed files with 40 additions and 18 deletions
|
|
@ -13,7 +13,8 @@ ColumnLayout {
|
||||||
|
|
||||||
required property var lock
|
required property var lock
|
||||||
readonly property list<string> timeComponents: Time.format(Config.services.useTwelveHourClock ? "hh:mm:A" : "hh:mm").split(":")
|
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.preferredWidth: centerWidth
|
||||||
Layout.fillHeight: true
|
Layout.fillHeight: true
|
||||||
|
|
@ -28,7 +29,7 @@ ColumnLayout {
|
||||||
Layout.alignment: Qt.AlignVCenter
|
Layout.alignment: Qt.AlignVCenter
|
||||||
text: root.timeComponents[0]
|
text: root.timeComponents[0]
|
||||||
color: Colours.palette.m3secondary
|
color: Colours.palette.m3secondary
|
||||||
font.pointSize: Appearance.font.size.extraLarge * 3
|
font.pointSize: Appearance.font.size.extraLarge * 3 * root.centerScale
|
||||||
font.bold: true
|
font.bold: true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -36,7 +37,7 @@ ColumnLayout {
|
||||||
Layout.alignment: Qt.AlignVCenter
|
Layout.alignment: Qt.AlignVCenter
|
||||||
text: ":"
|
text: ":"
|
||||||
color: Colours.palette.m3primary
|
color: Colours.palette.m3primary
|
||||||
font.pointSize: Appearance.font.size.extraLarge * 3
|
font.pointSize: Appearance.font.size.extraLarge * 3 * root.centerScale
|
||||||
font.bold: true
|
font.bold: true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -44,7 +45,7 @@ ColumnLayout {
|
||||||
Layout.alignment: Qt.AlignVCenter
|
Layout.alignment: Qt.AlignVCenter
|
||||||
text: root.timeComponents[1]
|
text: root.timeComponents[1]
|
||||||
color: Colours.palette.m3secondary
|
color: Colours.palette.m3secondary
|
||||||
font.pointSize: Appearance.font.size.extraLarge * 3
|
font.pointSize: Appearance.font.size.extraLarge * 3 * root.centerScale
|
||||||
font.bold: true
|
font.bold: true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -59,7 +60,7 @@ ColumnLayout {
|
||||||
sourceComponent: StyledText {
|
sourceComponent: StyledText {
|
||||||
text: root.timeComponents[2] ?? ""
|
text: root.timeComponents[2] ?? ""
|
||||||
color: Colours.palette.m3primary
|
color: Colours.palette.m3primary
|
||||||
font.pointSize: Appearance.font.size.extraLarge * 2
|
font.pointSize: Appearance.font.size.extraLarge * 2 * root.centerScale
|
||||||
font.bold: true
|
font.bold: true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -71,7 +72,7 @@ ColumnLayout {
|
||||||
|
|
||||||
text: Time.format("dddd, d MMMM yyyy")
|
text: Time.format("dddd, d MMMM yyyy")
|
||||||
color: Colours.palette.m3tertiary
|
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.family: Appearance.font.family.mono
|
||||||
font.bold: true
|
font.bold: true
|
||||||
}
|
}
|
||||||
|
|
@ -92,7 +93,7 @@ ColumnLayout {
|
||||||
text: "person"
|
text: "person"
|
||||||
fill: 1
|
fill: 1
|
||||||
grade: 200
|
grade: 200
|
||||||
font.pointSize: Math.floor(root.centerWidth / 4) || 1
|
font.pointSize: Math.floor(root.centerWidth / 4)
|
||||||
}
|
}
|
||||||
|
|
||||||
CachingImage {
|
CachingImage {
|
||||||
|
|
|
||||||
|
|
@ -87,12 +87,26 @@ ColumnLayout {
|
||||||
Layout.leftMargin: iconLoader.active ? 0 : width * 0.1
|
Layout.leftMargin: iconLoader.active ? 0 : width * 0.1
|
||||||
spacing: Appearance.spacing.normal
|
spacing: Appearance.spacing.normal
|
||||||
|
|
||||||
FetchText {
|
Loader {
|
||||||
text: `OS : ${SysInfo.osPrettyName || SysInfo.osName}`
|
Layout.fillWidth: true
|
||||||
|
asynchronous: true
|
||||||
|
active: root.height > 200
|
||||||
|
visible: active
|
||||||
|
|
||||||
|
sourceComponent: FetchText {
|
||||||
|
text: `OS : ${SysInfo.osPrettyName || SysInfo.osName}`
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
FetchText {
|
Loader {
|
||||||
text: `WM : ${SysInfo.wm}`
|
Layout.fillWidth: true
|
||||||
|
asynchronous: true
|
||||||
|
active: root.height > 110
|
||||||
|
visible: active
|
||||||
|
|
||||||
|
sourceComponent: FetchText {
|
||||||
|
text: `WM : ${SysInfo.wm}`
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
FetchText {
|
FetchText {
|
||||||
|
|
@ -109,7 +123,7 @@ ColumnLayout {
|
||||||
Layout.alignment: Qt.AlignHCenter
|
Layout.alignment: Qt.AlignHCenter
|
||||||
|
|
||||||
asynchronous: true
|
asynchronous: true
|
||||||
active: root.height > 220
|
active: root.height > 180
|
||||||
visible: active
|
visible: active
|
||||||
|
|
||||||
sourceComponent: RowLayout {
|
sourceComponent: RowLayout {
|
||||||
|
|
|
||||||
|
|
@ -18,17 +18,24 @@ ColumnLayout {
|
||||||
|
|
||||||
spacing: Appearance.spacing.small
|
spacing: Appearance.spacing.small
|
||||||
|
|
||||||
StyledText {
|
Loader {
|
||||||
Layout.topMargin: Appearance.padding.large * 2
|
Layout.topMargin: Appearance.padding.large * 2
|
||||||
|
Layout.bottomMargin: -Appearance.padding.large
|
||||||
Layout.alignment: Qt.AlignHCenter
|
Layout.alignment: Qt.AlignHCenter
|
||||||
text: qsTr("Weather")
|
|
||||||
color: Colours.palette.m3primary
|
asynchronous: true
|
||||||
font.pointSize: Appearance.font.size.extraLarge
|
active: root.rootHeight > 610
|
||||||
font.weight: 500
|
visible: active
|
||||||
|
|
||||||
|
sourceComponent: StyledText {
|
||||||
|
text: qsTr("Weather")
|
||||||
|
color: Colours.palette.m3primary
|
||||||
|
font.pointSize: Appearance.font.size.extraLarge
|
||||||
|
font.weight: 500
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
RowLayout {
|
RowLayout {
|
||||||
Layout.bottomMargin: forecastLoader.active ? 0 : Appearance.padding.large
|
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
spacing: Appearance.spacing.large
|
spacing: Appearance.spacing.large
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue