refactor: migrate lock to new font API
This commit is contained in:
parent
a3e84b555e
commit
a43fc61fad
8 changed files with 38 additions and 63 deletions
|
|
@ -30,27 +30,21 @@ ColumnLayout {
|
|||
Layout.alignment: Qt.AlignVCenter
|
||||
text: Time.hourStr
|
||||
color: Colours.palette.m3secondary
|
||||
font.pointSize: Math.floor(Tokens.font.size.extraLarge * 3 * root.centerScale)
|
||||
font.family: Tokens.font.family.clock
|
||||
font.bold: true
|
||||
font: Tokens.font.clock.size(Math.floor(28 * 3 * root.centerScale)).weight(Font.Bold).build()
|
||||
}
|
||||
|
||||
StyledText {
|
||||
Layout.alignment: Qt.AlignVCenter
|
||||
text: ":"
|
||||
color: Colours.palette.m3primary
|
||||
font.pointSize: Math.floor(Tokens.font.size.extraLarge * 3 * root.centerScale)
|
||||
font.family: Tokens.font.family.clock
|
||||
font.bold: true
|
||||
font: Tokens.font.clock.size(Math.floor(28 * 3 * root.centerScale)).weight(Font.Bold).build()
|
||||
}
|
||||
|
||||
StyledText {
|
||||
Layout.alignment: Qt.AlignVCenter
|
||||
text: Time.minuteStr
|
||||
color: Colours.palette.m3secondary
|
||||
font.pointSize: Math.floor(Tokens.font.size.extraLarge * 3 * root.centerScale)
|
||||
font.family: Tokens.font.family.clock
|
||||
font.bold: true
|
||||
font: Tokens.font.clock.size(Math.floor(28 * 3 * root.centerScale)).weight(Font.Bold).build()
|
||||
}
|
||||
|
||||
Loader {
|
||||
|
|
@ -64,9 +58,7 @@ ColumnLayout {
|
|||
sourceComponent: StyledText {
|
||||
text: Time.amPmStr
|
||||
color: Colours.palette.m3primary
|
||||
font.pointSize: Math.floor(Tokens.font.size.extraLarge * 2 * root.centerScale)
|
||||
font.family: Tokens.font.family.clock
|
||||
font.bold: true
|
||||
font: Tokens.font.clock.size(Math.floor(28 * 2 * root.centerScale)).weight(Font.Bold).build()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -77,9 +69,7 @@ ColumnLayout {
|
|||
|
||||
text: Time.format("dddd, d MMMM yyyy")
|
||||
color: Colours.palette.m3tertiary
|
||||
font.pointSize: Math.floor(Tokens.font.size.extraLarge * root.centerScale)
|
||||
font.family: Tokens.font.family.mono
|
||||
font.bold: true
|
||||
font: Tokens.font.mono.builders.large.size(Math.floor(28 * root.centerScale)).weight(Font.Bold).build()
|
||||
}
|
||||
|
||||
StyledClippingRect {
|
||||
|
|
@ -97,7 +87,7 @@ ColumnLayout {
|
|||
|
||||
text: "person"
|
||||
color: Colours.palette.m3onSurfaceVariant
|
||||
font.pointSize: Math.floor(root.centerWidth / 4)
|
||||
font: Tokens.font.icon.builders.large.size(Math.floor(root.centerWidth / 4)).build()
|
||||
visible: pfp.status !== Image.Ready
|
||||
}
|
||||
|
||||
|
|
@ -204,7 +194,7 @@ ColumnLayout {
|
|||
anchors.centerIn: parent
|
||||
text: "arrow_forward"
|
||||
color: root.lock.pam.buffer ? Colours.palette.m3onPrimary : Colours.palette.m3onSurface
|
||||
font.weight: 500
|
||||
font: Tokens.font.icon.builders.large.weight(500).build()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -269,7 +259,7 @@ ColumnLayout {
|
|||
color: Colours.palette.m3onSurfaceVariant
|
||||
animateProp: "opacity"
|
||||
|
||||
font.family: Tokens.font.family.mono
|
||||
font: Tokens.font.mono.small
|
||||
horizontalAlignment: Qt.AlignHCenter
|
||||
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
|
||||
lineHeight: 1.2
|
||||
|
|
@ -324,8 +314,7 @@ ColumnLayout {
|
|||
opacity: 0
|
||||
color: Colours.palette.m3error
|
||||
|
||||
font.pointSize: Tokens.font.size.small
|
||||
font.family: Tokens.font.family.mono
|
||||
font: Tokens.font.mono.small
|
||||
horizontalAlignment: Qt.AlignHCenter
|
||||
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
|
||||
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ ColumnLayout {
|
|||
|
||||
anchors.centerIn: parent
|
||||
text: ">"
|
||||
font.pointSize: root.width > 400 ? Tokens.font.size.larger : Tokens.font.size.normal
|
||||
font: root.width > 400 ? Tokens.font.mono.large : Tokens.font.mono.medium
|
||||
color: Colours.palette.m3onPrimary
|
||||
}
|
||||
}
|
||||
|
|
@ -43,7 +43,7 @@ ColumnLayout {
|
|||
MonoText {
|
||||
Layout.fillWidth: true
|
||||
text: "caelestiafetch.sh"
|
||||
font.pointSize: root.width > 400 ? Tokens.font.size.larger : Tokens.font.size.normal
|
||||
font: root.width > 400 ? Tokens.font.mono.large : Tokens.font.mono.medium
|
||||
elide: Text.ElideRight
|
||||
}
|
||||
|
||||
|
|
@ -128,13 +128,13 @@ ColumnLayout {
|
|||
spacing: Tokens.spacing.largeIncreased
|
||||
|
||||
Repeater {
|
||||
model: Math.max(0, Math.min(8, root.width / (Tokens.font.size.larger * 2 + Tokens.spacing.largeIncreased)))
|
||||
model: Math.max(0, Math.min(8, root.width / (Tokens.font.body.large.pointSize * 2 + Tokens.spacing.large)))
|
||||
|
||||
StyledRect {
|
||||
required property int index
|
||||
|
||||
implicitWidth: implicitHeight
|
||||
implicitHeight: Tokens.font.size.larger * 2
|
||||
implicitHeight: Tokens.font.body.large.pointSize * 2
|
||||
color: Colours.palette[`term${index}`]
|
||||
radius: Tokens.rounding.medium
|
||||
}
|
||||
|
|
@ -168,11 +168,11 @@ ColumnLayout {
|
|||
|
||||
component FetchText: MonoText {
|
||||
Layout.fillWidth: true
|
||||
font.pointSize: root.width > 400 ? Tokens.font.size.larger : Tokens.font.size.normal
|
||||
font: root.width > 400 ? Tokens.font.mono.large : Tokens.font.mono.medium
|
||||
elide: Text.ElideRight
|
||||
}
|
||||
|
||||
component MonoText: StyledText {
|
||||
font.family: Tokens.font.family.mono
|
||||
font: Tokens.font.mono.small
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -49,8 +49,7 @@ Item {
|
|||
|
||||
animate: true
|
||||
color: root.pam.passwd.active ? Colours.palette.m3secondary : Colours.palette.m3outline
|
||||
font.pointSize: Tokens.font.size.normal
|
||||
font.family: Tokens.font.family.mono
|
||||
font: Tokens.font.mono.medium
|
||||
|
||||
opacity: root.buffer ? 0 : 1
|
||||
|
||||
|
|
@ -74,7 +73,7 @@ Item {
|
|||
anchors.horizontalCenterOffset: implicitWidth > root.width ? -(implicitWidth - root.width) / 2 : 0
|
||||
|
||||
implicitWidth: fullWidth
|
||||
implicitHeight: Tokens.font.size.normal
|
||||
implicitHeight: Tokens.font.body.medium.pointSize
|
||||
|
||||
orientation: Qt.Horizontal
|
||||
spacing: Tokens.spacing.extraSmall
|
||||
|
|
|
|||
|
|
@ -207,8 +207,7 @@ WlSessionLockSurface {
|
|||
|
||||
anchors.centerIn: parent
|
||||
text: "lock"
|
||||
font.pointSize: Tokens.font.size.extraLarge * 4
|
||||
font.bold: true
|
||||
font: Tokens.font.icon.builders.extraLarge.size(Tokens.font.icon.extraLarge.pointSize * 4).weight(Font.Bold).build()
|
||||
rotation: 180
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -76,8 +76,7 @@ Item {
|
|||
Layout.bottomMargin: Tokens.spacing.large
|
||||
text: qsTr("Now playing")
|
||||
color: Colours.palette.m3onSurfaceVariant
|
||||
font.family: Tokens.font.family.mono
|
||||
font.weight: 500
|
||||
font: Tokens.font.mono.builders.small.weight(500).build()
|
||||
}
|
||||
|
||||
StyledText {
|
||||
|
|
@ -86,9 +85,7 @@ Item {
|
|||
text: Players.active?.trackArtist ?? qsTr("No media")
|
||||
color: Colours.palette.m3primary
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
font.pointSize: Tokens.font.size.large
|
||||
font.family: Tokens.font.family.mono
|
||||
font.weight: 600
|
||||
font: Tokens.font.mono.builders.large.weight(600).build()
|
||||
elide: Text.ElideRight
|
||||
}
|
||||
|
||||
|
|
@ -97,8 +94,7 @@ Item {
|
|||
animate: true
|
||||
text: Players.active?.trackTitle ?? qsTr("No media")
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
font.pointSize: Tokens.font.size.larger
|
||||
font.family: Tokens.font.family.mono
|
||||
font: Tokens.font.mono.large
|
||||
elide: Text.ElideRight
|
||||
}
|
||||
|
||||
|
|
@ -176,7 +172,7 @@ Item {
|
|||
|
||||
anchors.centerIn: parent
|
||||
color: control.active ? Colours.palette[`m3on${control.colour}`] : Colours.palette[`m3on${control.colour}Container`]
|
||||
font.pointSize: Tokens.font.size.large
|
||||
font: Tokens.font.icon.large
|
||||
fill: control.active ? 1 : 0
|
||||
|
||||
Behavior on fill {
|
||||
|
|
|
|||
|
|
@ -25,8 +25,7 @@ ColumnLayout {
|
|||
Layout.fillWidth: true
|
||||
text: Notifs.list.length > 0 ? qsTr("%1 notification%2").arg(Notifs.list.length).arg(Notifs.list.length === 1 ? "" : "s") : qsTr("Notifications")
|
||||
color: Colours.palette.m3outline
|
||||
font.family: Tokens.font.family.mono
|
||||
font.weight: 500
|
||||
font: Tokens.font.mono.builders.small.weight(500).build()
|
||||
elide: Text.ElideRight
|
||||
}
|
||||
|
||||
|
|
@ -65,9 +64,7 @@ ColumnLayout {
|
|||
Layout.alignment: Qt.AlignHCenter
|
||||
text: Config.lock.hideNotifs ? qsTr("Unlock for Notifications") : qsTr("No Notifications")
|
||||
color: Colours.palette.m3outlineVariant
|
||||
font.pointSize: Tokens.font.size.large
|
||||
font.family: Tokens.font.family.mono
|
||||
font.weight: 500
|
||||
font: Tokens.font.mono.builders.large.weight(500).build()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -99,7 +99,7 @@ StyledRect {
|
|||
MaterialIcon {
|
||||
text: Icons.getNotifIcon(root.notifs[0]?.summary, root.urgency)
|
||||
color: root.urgency === "critical" ? Colours.palette.m3onError : root.urgency === "low" ? Colours.palette.m3onSurface : Colours.palette.m3onSecondaryContainer
|
||||
font.pointSize: Tokens.font.size.large
|
||||
font: Tokens.font.icon.large
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -154,7 +154,7 @@ StyledRect {
|
|||
Layout.fillWidth: true
|
||||
text: root.modelData
|
||||
color: Colours.palette.m3onSurfaceVariant
|
||||
font.pointSize: Tokens.font.size.small
|
||||
font: Tokens.font.body.small
|
||||
elide: Text.ElideRight
|
||||
}
|
||||
|
||||
|
|
@ -162,7 +162,7 @@ StyledRect {
|
|||
animate: true
|
||||
text: root.notifs[0]?.timeStr ?? ""
|
||||
color: Colours.palette.m3outline
|
||||
font.pointSize: Tokens.font.size.small
|
||||
font: Tokens.font.body.small
|
||||
}
|
||||
|
||||
StyledRect {
|
||||
|
|
@ -193,7 +193,7 @@ StyledRect {
|
|||
animate: true
|
||||
text: root.notifs.length
|
||||
color: root.urgency === "critical" ? Colours.palette.m3onError : Colours.palette.m3onSurface
|
||||
font.pointSize: Tokens.font.size.small
|
||||
font: Tokens.font.body.small
|
||||
}
|
||||
|
||||
MaterialIcon {
|
||||
|
|
@ -329,8 +329,7 @@ StyledRect {
|
|||
id: metrics
|
||||
|
||||
text: `${notifLine.modelData.summary} ${notifLine.modelData.body}`.replace(/\n/g, " ")
|
||||
font.pointSize: notifLine.font.pointSize
|
||||
font.family: notifLine.font.family
|
||||
font: notifLine.font
|
||||
elideWidth: notifLine.width
|
||||
elide: Text.ElideRight
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,8 +29,7 @@ ColumnLayout {
|
|||
sourceComponent: StyledText {
|
||||
text: qsTr("Weather")
|
||||
color: Colours.palette.m3primary
|
||||
font.pointSize: Tokens.font.size.extraLarge
|
||||
font.weight: 500
|
||||
font: Tokens.font.body.builders.large.size(28).weight(500).build()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -42,7 +41,7 @@ ColumnLayout {
|
|||
animate: true
|
||||
text: Weather.icon
|
||||
color: Colours.palette.m3secondary
|
||||
font.pointSize: Tokens.font.size.extraLarge * 2.5
|
||||
font: Tokens.font.icon.builders.extraLarge.size(Tokens.font.icon.extraLarge.pointSize * 2.5).build()
|
||||
}
|
||||
|
||||
ColumnLayout {
|
||||
|
|
@ -54,8 +53,7 @@ ColumnLayout {
|
|||
animate: true
|
||||
text: Weather.description
|
||||
color: Colours.palette.m3secondary
|
||||
font.pointSize: Tokens.font.size.large
|
||||
font.weight: 500
|
||||
font: Tokens.font.body.builders.large.weight(500).build()
|
||||
elide: Text.ElideRight
|
||||
}
|
||||
|
||||
|
|
@ -65,7 +63,7 @@ ColumnLayout {
|
|||
animate: true
|
||||
text: qsTr("Humidity: %1%").arg(Weather.humidity)
|
||||
color: Colours.palette.m3onSurfaceVariant
|
||||
font.pointSize: Tokens.font.size.normal
|
||||
font: Tokens.font.body.medium
|
||||
elide: Text.ElideRight
|
||||
}
|
||||
}
|
||||
|
|
@ -86,8 +84,7 @@ ColumnLayout {
|
|||
text: Weather.temp
|
||||
color: Colours.palette.m3primary
|
||||
horizontalAlignment: Text.AlignRight
|
||||
font.pointSize: Tokens.font.size.extraLarge
|
||||
font.weight: 500
|
||||
font: Tokens.font.body.builders.large.size(28).weight(500).build()
|
||||
elide: Text.ElideLeft
|
||||
}
|
||||
|
||||
|
|
@ -98,7 +95,7 @@ ColumnLayout {
|
|||
text: qsTr("Feels like: %1").arg(Weather.feelsLike)
|
||||
color: Colours.palette.m3outline
|
||||
horizontalAlignment: Text.AlignRight
|
||||
font.pointSize: Tokens.font.size.smaller
|
||||
font: Tokens.font.body.small
|
||||
elide: Text.ElideLeft
|
||||
}
|
||||
}
|
||||
|
|
@ -147,21 +144,20 @@ ColumnLayout {
|
|||
}
|
||||
color: Colours.palette.m3outline
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
font.pointSize: Tokens.font.size.larger
|
||||
font: Tokens.font.body.large
|
||||
}
|
||||
|
||||
MaterialIcon {
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
text: forecastHour.modelData?.icon ?? "cloud_alert"
|
||||
font.pointSize: Tokens.font.size.extraLarge * 1.5
|
||||
font.weight: 500
|
||||
font: Tokens.font.icon.builders.extraLarge.size(Tokens.font.icon.extraLarge.pointSize * 1.5).weight(500).build()
|
||||
}
|
||||
|
||||
StyledText {
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
text: GlobalConfig.services.useFahrenheit ? `${forecastHour.modelData?.tempF ?? 0}°F` : `${forecastHour.modelData?.tempC ?? 0}°C`
|
||||
color: Colours.palette.m3secondary
|
||||
font.pointSize: Tokens.font.size.larger
|
||||
font: Tokens.font.body.large
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue