refactor: migrate background/winfo/session to new font API

This commit is contained in:
2 * r + 2 * t 2026-04-21 01:05:29 +10:00
parent f639b04310
commit 61555294e6
6 changed files with 19 additions and 30 deletions

View file

@ -81,14 +81,13 @@ Item {
StyledText {
text: Time.hourStr
font.pointSize: Tokens.font.size.extraLarge * 3 * root.clockScale
font.weight: Font.Bold
font: Tokens.font.clock.size(Tokens.font.headline.medium.pointSize * 3 * root.clockScale).weight(Font.Bold).build()
color: root.safePrimary
}
StyledText {
text: ":"
font.pointSize: Tokens.font.size.extraLarge * 3 * root.clockScale
font: Tokens.font.clock.size(Tokens.font.headline.medium.pointSize * 3 * root.clockScale).build()
color: root.safeTertiary
opacity: 0.8
Layout.topMargin: -Tokens.padding.large * 1.5 * root.clockScale
@ -96,8 +95,7 @@ Item {
StyledText {
text: Time.minuteStr
font.pointSize: Tokens.font.size.extraLarge * 3 * root.clockScale
font.weight: Font.Bold
font: Tokens.font.clock.size(Tokens.font.headline.medium.pointSize * 3 * root.clockScale).weight(Font.Bold).build()
color: root.safeSecondary
}
@ -111,7 +109,7 @@ Item {
sourceComponent: StyledText {
text: Time.amPmStr
font.pointSize: Tokens.font.size.large * root.clockScale
font: Tokens.font.clock.size(Tokens.font.title.medium.pointSize * root.clockScale).build()
color: root.safeSecondary
}
}
@ -132,24 +130,19 @@ Item {
StyledText {
text: Time.format("MMMM").toUpperCase()
font.pointSize: Tokens.font.size.large * root.clockScale
font.letterSpacing: 4
font.weight: Font.Bold
font: Tokens.font.clock.size(Tokens.font.title.medium.pointSize * root.clockScale).letterSpacing(4).weight(Font.Bold).build()
color: root.safeSecondary
}
StyledText {
text: Time.format("dd")
font.pointSize: Tokens.font.size.extraLarge * root.clockScale
font.letterSpacing: 2
font.weight: Font.Medium
font: Tokens.font.clock.size(Tokens.font.headline.medium.pointSize * root.clockScale).letterSpacing(2).weight(Font.Medium).build()
color: root.safePrimary
}
StyledText {
text: Time.format("dddd")
font.pointSize: Tokens.font.size.larger * root.clockScale
font.letterSpacing: 2
font: Tokens.font.clock.size(Tokens.font.body.large.pointSize * root.clockScale).letterSpacing(2).build()
color: root.safeSecondary
}
}

View file

@ -48,7 +48,7 @@ Item {
MaterialIcon {
text: "sentiment_stressed"
color: Colours.palette.m3onSurfaceVariant
font.pointSize: Tokens.font.size.extraLarge * 5
font: Tokens.font.icon.builders.extraLarge.size(Tokens.font.icon.extraLarge.pointSize * 5).build()
}
Column {
@ -58,8 +58,7 @@ Item {
StyledText {
text: qsTr("Wallpaper missing?")
color: Colours.palette.m3onSurfaceVariant
font.pointSize: Tokens.font.size.extraLarge * 2
font.bold: true
font: Tokens.font.body.builders.large.size(28 * 2).weight(Font.Bold).build()
}
StyledRect {
@ -91,7 +90,7 @@ Item {
text: qsTr("Set it now!")
color: Colours.palette.m3onPrimary
font.pointSize: Tokens.font.size.large
font: Tokens.font.body.large
}
}
}

View file

@ -125,8 +125,7 @@ Column {
text: button.icon
color: button.activeFocus ? Colours.palette.m3onSecondaryContainer : Colours.palette.m3onSurface
font.pointSize: Tokens.font.size.extraLarge
font.weight: 500
font: Tokens.font.icon.builders.extraLarge.weight(500).build()
}
}
}

View file

@ -49,7 +49,7 @@ ColumnLayout {
animate: true
text: root.moveToWsExpanded ? "expand_more" : "keyboard_arrow_right"
color: Colours.palette.m3onPrimary
font.pointSize: Tokens.font.size.large
font: Tokens.font.icon.large
}
}
}
@ -161,7 +161,7 @@ ColumnLayout {
animate: true
color: parent.onColor
font.pointSize: Tokens.font.size.normal
font: Tokens.font.body.medium
}
}
}

View file

@ -19,15 +19,14 @@ ColumnLayout {
text: root.client?.title ?? qsTr("No active client")
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
font.pointSize: Tokens.font.size.large
font.weight: 500
font: Tokens.font.body.builders.large.weight(500).build()
}
Label {
text: root.client?.lastIpcObject.class ?? qsTr("No active client")
color: Colours.palette.m3tertiary
font.pointSize: Tokens.font.size.larger
font: Tokens.font.body.large
}
StyledRect {
@ -149,7 +148,7 @@ ColumnLayout {
text: detail.text
elide: Text.ElideRight
font.pointSize: Tokens.font.size.normal
font: Tokens.font.body.medium
}
}

View file

@ -44,22 +44,21 @@ Item {
Layout.alignment: Qt.AlignHCenter
text: "web_asset_off"
color: Colours.palette.m3outline
font.pointSize: Tokens.font.size.extraLarge * 3
font: Tokens.font.icon.builders.extraLarge.size(Tokens.font.icon.extraLarge.pointSize * 3).build()
}
StyledText {
Layout.alignment: Qt.AlignHCenter
text: qsTr("No active client")
color: Colours.palette.m3outline
font.pointSize: Tokens.font.size.extraLarge
font.weight: 500
font: Tokens.font.body.builders.large.size(28).weight(500).build()
}
StyledText {
Layout.alignment: Qt.AlignHCenter
text: qsTr("Try switching to a window")
color: Colours.palette.m3outline
font.pointSize: Tokens.font.size.large
font: Tokens.font.body.large
}
}
}