refactor: migrate dashboard dash to new font API

This commit is contained in:
2 * r + 2 * t 2026-04-21 01:16:35 +10:00
parent ee60493bec
commit 71bbebb242
5 changed files with 21 additions and 34 deletions

View file

@ -61,8 +61,7 @@ CustomMouseArea {
anchors.centerIn: parent
text: "chevron_left"
color: Colours.palette.m3tertiary
font.pointSize: Tokens.font.size.normal
font.weight: 700
font: Tokens.font.icon.builders.medium.weight(700).build()
}
}
@ -95,9 +94,7 @@ CustomMouseArea {
anchors.centerIn: parent
text: grid.title
color: Colours.palette.m3primary
font.pointSize: Tokens.font.size.normal
font.weight: 500
font.capitalization: Font.Capitalize
font: Tokens.font.body.builders.medium.weight(500).capitalisation(Font.Capitalize).build()
}
}
@ -121,8 +118,7 @@ CustomMouseArea {
anchors.centerIn: parent
text: "chevron_right"
color: Colours.palette.m3tertiary
font.pointSize: Tokens.font.size.normal
font.weight: 700
font: Tokens.font.icon.builders.medium.weight(700).build()
}
}
}
@ -138,7 +134,7 @@ CustomMouseArea {
horizontalAlignment: Text.AlignHCenter
text: model.shortName
font.weight: 500
font: Tokens.font.body.builders.medium.weight(500).build()
color: (model.day === 0 || model.day === 6) ? Colours.palette.m3secondary : Colours.palette.m3onSurfaceVariant
}
}
@ -181,8 +177,7 @@ CustomMouseArea {
return Colours.palette.m3onSurfaceVariant;
}
opacity: dayItem.model.today || dayItem.model.month === grid.month ? 1 : 0.4
font.pointSize: Tokens.font.size.normal
font.weight: 500
font: Tokens.font.body.builders.medium.weight(500).build()
}
}
}

View file

@ -24,17 +24,14 @@ Item {
Layout.alignment: Qt.AlignHCenter
text: Time.hourStr
color: Colours.palette.m3secondary
font.pointSize: Tokens.font.size.extraLarge
font.family: Tokens.font.family.clock
font.weight: 600
font: Tokens.font.clock.builders.size(28).weight(600).build()
}
StyledText {
Layout.alignment: Qt.AlignHCenter
text: "•••"
color: Colours.palette.m3primary
font.pointSize: Tokens.font.size.extraLarge * 0.9
font.family: Tokens.font.family.clock
font: Tokens.font.clock.builders.size(28 * 0.9).build()
}
StyledText {
@ -42,9 +39,7 @@ Item {
Layout.alignment: Qt.AlignHCenter
text: Time.minuteStr
color: Colours.palette.m3secondary
font.pointSize: Tokens.font.size.extraLarge
font.family: Tokens.font.family.clock
font.weight: 600
font: Tokens.font.clock.builders.size(28).weight(600).build()
}
Loader {
@ -57,9 +52,7 @@ Item {
sourceComponent: StyledText {
text: Time.amPmStr
color: Colours.palette.m3primary
font.pointSize: Tokens.font.size.large
font.family: Tokens.font.family.clock
font.weight: 600
font: Tokens.font.clock.builders.size(18).weight(600).build()
}
}
}

View file

@ -98,7 +98,7 @@ Item {
grade: 200
text: "art_track"
color: Colours.palette.m3onSurfaceVariant
font.pointSize: (parent.width * 0.4) || 1
font: Tokens.font.icon.builders.medium.size((parent.width * 0.4) || 1).build()
}
Image {
@ -125,7 +125,7 @@ Item {
horizontalAlignment: Text.AlignHCenter
text: (Players.active?.trackTitle ?? qsTr("No media")) || qsTr("Unknown title")
color: Colours.palette.m3primary
font.pointSize: Tokens.font.size.normal
font: Tokens.font.title.small
width: parent.implicitWidth - Tokens.padding.extraLargeIncreased
elide: Text.ElideRight
@ -142,7 +142,7 @@ Item {
horizontalAlignment: Text.AlignHCenter
text: (Players.active?.trackAlbum ?? qsTr("No media")) || qsTr("Unknown album")
color: Colours.palette.m3outline
font.pointSize: Tokens.font.size.small
font: Tokens.font.body.small
width: parent.implicitWidth - Tokens.padding.extraLargeIncreased
elide: Text.ElideRight
@ -236,7 +236,7 @@ Item {
animate: true
text: control.icon
color: control.canUse ? Colours.palette.m3onSurface : Colours.palette.m3outline
font.pointSize: Tokens.font.size.large
font: Tokens.font.icon.large
}
}
}

View file

@ -21,7 +21,7 @@ Item {
animate: true
text: Weather.icon
color: Colours.palette.m3secondary
font.pointSize: Tokens.font.size.extraLarge * 2
font: Tokens.font.icon.builders.xl.size(Tokens.font.icon.xl.pointSize * 2).build()
}
Column {
@ -39,8 +39,7 @@ Item {
animate: true
text: Weather.temp
color: Colours.palette.m3primary
font.pointSize: Tokens.font.size.extraLarge
font.weight: 500
font: Tokens.font.body.builders.size(28).weight(500).build()
}
StyledText {

View file

@ -29,7 +29,7 @@ Row {
text: "person"
fill: 1
grade: 200
font.pointSize: Math.floor(info.implicitHeight / 2) || 1
font: Tokens.font.icon.builders.medium.size(Math.floor(info.implicitHeight / 2) || 1).build()
visible: pfp.status !== Image.Ready
}
@ -84,7 +84,7 @@ Row {
text: "frame_person"
color: Colours.palette.m3onPrimary
font.pointSize: Tokens.font.size.extraLarge
font: Tokens.font.icon.xl
}
Behavior on scale {
@ -121,7 +121,7 @@ Row {
anchors.leftMargin: (Tokens.sizes.dashboard.infoIconSize - implicitWidth) / 2
source: SysInfo.osLogo
implicitSize: Math.floor(Tokens.font.size.normal * 1.34)
implicitSize: Math.floor(Tokens.font.body.medium.pointSize * 1.34)
colour: Colours.palette.m3primary
}
@ -132,7 +132,7 @@ Row {
anchors.left: icon.right
anchors.leftMargin: icon.anchors.leftMargin
text: `: ${SysInfo.osPrettyName || SysInfo.osName}`
font.pointSize: Tokens.font.size.normal
font: Tokens.font.body.medium
width: Tokens.sizes.dashboard.infoWidth
elide: Text.ElideRight
@ -173,7 +173,7 @@ Row {
fill: 1
text: line.icon
color: line.colour
font.pointSize: Tokens.font.size.normal
font: Tokens.font.icon.medium
}
StyledText {
@ -183,7 +183,7 @@ Row {
anchors.left: icon.right
anchors.leftMargin: icon.anchors.leftMargin
text: `: ${line.text}`
font.pointSize: Tokens.font.size.normal
font: Tokens.font.body.medium
width: Tokens.sizes.dashboard.infoWidth
elide: Text.ElideRight