refactor: migrate rest of dashboard to new font API

This commit is contained in:
2 * r + 2 * t 2026-04-21 01:22:14 +10:00
parent 71bbebb242
commit e2349f2202
6 changed files with 72 additions and 86 deletions

View file

@ -41,7 +41,7 @@ StyledRect {
text: "lyrics" text: "lyrics"
fill: 1 fill: 1
color: Colours.palette.m3primary color: Colours.palette.m3primary
font.pointSize: Tokens.spacing.largeIncreased font: Tokens.font.icon.builders.medium.size(Tokens.spacing.large).build()
} }
Rectangle { Rectangle {
@ -53,7 +53,7 @@ StyledRect {
StyledText { StyledText {
anchors.centerIn: parent anchors.centerIn: parent
text: LyricsService.preferredBackend text: LyricsService.preferredBackend
font.pointSize: Tokens.font.size.small font: Tokens.font.body.small
color: Colours.palette.m3primary color: Colours.palette.m3primary
} }
@ -80,7 +80,7 @@ StyledRect {
StyledText { StyledText {
anchors.centerIn: parent anchors.centerIn: parent
text: LyricsService.backend text: LyricsService.backend
font.pointSize: Tokens.font.size.small font: Tokens.font.body.small
color: LyricsService.backend === "Local" ? Colours.palette.m3tertiary : Colours.palette.m3secondary color: LyricsService.backend === "Local" ? Colours.palette.m3tertiary : Colours.palette.m3secondary
} }
} }
@ -105,7 +105,7 @@ StyledRect {
Layout.fillWidth: true Layout.fillWidth: true
text: LyricsService.preferredBackend === "Local" ? "Loaded File:" : "Fetched Candidates:" text: LyricsService.preferredBackend === "Local" ? "Loaded File:" : "Fetched Candidates:"
color: Colours.palette.m3outline color: Colours.palette.m3outline
font.pointSize: Tokens.font.size.small font: Tokens.font.body.small
elide: Text.ElideRight elide: Text.ElideRight
visible: LyricsService.preferredBackend === "Local" ? LyricsService.loadedLocalFile.length > 0 : LyricsService.candidatesModel.count > 0 visible: LyricsService.preferredBackend === "Local" ? LyricsService.loadedLocalFile.length > 0 : LyricsService.candidatesModel.count > 0
} }
@ -130,7 +130,7 @@ StyledRect {
const parts = path.split('/'); const parts = path.split('/');
return parts[parts.length - 1]; return parts[parts.length - 1];
} }
font.pointSize: Tokens.font.size.small font: Tokens.font.body.small
color: Colours.palette.m3tertiary color: Colours.palette.m3tertiary
elide: Text.ElideMiddle elide: Text.ElideMiddle
} }
@ -145,7 +145,7 @@ StyledRect {
} }
return ""; return "";
} }
font.pointSize: Tokens.font.size.small font: Tokens.font.body.small
color: Colours.palette.m3outline color: Colours.palette.m3outline
elide: Text.ElideMiddle elide: Text.ElideMiddle
} }
@ -253,8 +253,7 @@ StyledRect {
Text { Text {
text: delegateRoot.title text: delegateRoot.title
font.pointSize: Tokens.font.size.normal font: Tokens.font.body.builders.medium.weight(Font.Bold).build()
font.bold: true
color: delegateRoot.hovered ? Colours.palette.m3primary : Colours.palette.m3onSurface color: delegateRoot.hovered ? Colours.palette.m3primary : Colours.palette.m3onSurface
width: parent.width width: parent.width
elide: Text.ElideRight elide: Text.ElideRight
@ -268,7 +267,7 @@ StyledRect {
Text { Text {
text: delegateRoot.artist text: delegateRoot.artist
font.pointSize: Tokens.font.size.small font: Tokens.font.body.small
color: Colours.palette.m3onSurfaceVariant color: Colours.palette.m3onSurfaceVariant
elide: Text.ElideRight elide: Text.ElideRight
} }
@ -291,7 +290,7 @@ StyledRect {
StyledText { StyledText {
Layout.fillWidth: true Layout.fillWidth: true
text: "Manual Search" text: "Manual Search"
font.pointSize: Tokens.font.size.small font: Tokens.font.body.small
color: Colours.palette.m3onSurfaceVariant color: Colours.palette.m3onSurfaceVariant
elide: Text.ElideRight elide: Text.ElideRight
} }
@ -340,14 +339,14 @@ StyledRect {
MaterialIcon { MaterialIcon {
text: "contrast_square" text: "contrast_square"
font.pointSize: Tokens.font.size.large font: Tokens.font.icon.large
color: Colours.palette.m3secondary color: Colours.palette.m3secondary
} }
StyledText { StyledText {
text: "Offset" text: "Offset"
color: Colours.palette.m3outline color: Colours.palette.m3outline
font.pointSize: Tokens.font.size.normal font: Tokens.font.body.medium
} }
Item { Item {
@ -368,7 +367,7 @@ StyledRect {
horizontalAlignment: TextInput.AlignHCenter horizontalAlignment: TextInput.AlignHCenter
color: Colours.palette.m3secondary color: Colours.palette.m3secondary
font.pointSize: Tokens.font.size.normal font: Tokens.font.body.medium
selectByMouse: true selectByMouse: true
text: (LyricsService.offset >= 0 ? "+" : "") + LyricsService.offset.toFixed(1) + "s" text: (LyricsService.offset >= 0 ? "+" : "") + LyricsService.offset.toFixed(1) + "s"
onEditingFinished: { onEditingFinished: {

View file

@ -84,9 +84,8 @@ StyledListView {
anchors.centerIn: parent anchors.centerIn: parent
horizontalAlignment: Text.AlignHCenter horizontalAlignment: Text.AlignHCenter
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
font.pointSize: Tokens.font.size.normal font: delegateRoot.isCurrent ? Tokens.font.body.builders.medium.weight(Font.Bold).build() : Tokens.font.body.medium
color: delegateRoot.isCurrent ? Colours.palette.m3primary : Colours.palette.m3onSurfaceVariant color: delegateRoot.isCurrent ? Colours.palette.m3primary : Colours.palette.m3onSurfaceVariant
font.bold: delegateRoot.isCurrent
scale: delegateRoot.isCurrent ? 1.15 : 1.0 scale: delegateRoot.isCurrent ? 1.15 : 1.0
Behavior on color { Behavior on color {

View file

@ -173,7 +173,7 @@ Item {
grade: 200 grade: 200
text: "art_track" text: "art_track"
color: Colours.palette.m3onSurfaceVariant 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 { Image {
@ -215,7 +215,7 @@ Item {
horizontalAlignment: Text.AlignHCenter horizontalAlignment: Text.AlignHCenter
text: (Players.active?.trackTitle ?? qsTr("No media")) || qsTr("Unknown title") text: (Players.active?.trackTitle ?? qsTr("No media")) || qsTr("Unknown title")
color: Players.active ? Colours.palette.m3primary : Colours.palette.m3onSurface color: Players.active ? Colours.palette.m3primary : Colours.palette.m3onSurface
font.pointSize: Tokens.font.size.normal font: Tokens.font.title.small
elide: Text.ElideRight elide: Text.ElideRight
} }
@ -230,7 +230,7 @@ Item {
visible: !!Players.active visible: !!Players.active
text: Players.active?.trackAlbum || qsTr("Unknown album") text: Players.active?.trackAlbum || qsTr("Unknown album")
color: Colours.palette.m3outline color: Colours.palette.m3outline
font.pointSize: Tokens.font.size.small font: Tokens.font.body.small
elide: Text.ElideRight elide: Text.ElideRight
} }
@ -267,7 +267,7 @@ Item {
PlayerControl { PlayerControl {
type: IconButton.Text type: IconButton.Text
icon: Players.active?.shuffle ? "shuffle_on" : "shuffle" icon: Players.active?.shuffle ? "shuffle_on" : "shuffle"
font.pointSize: Math.round(Tokens.font.size.large) font: Tokens.font.icon.builders.large.size(Math.round(Tokens.font.icon.large.pointSize)).build()
disabled: !Players.active?.shuffleSupported disabled: !Players.active?.shuffleSupported
onClicked: Players.active.shuffle = !Players.active?.shuffle onClicked: Players.active.shuffle = !Players.active?.shuffle
} }
@ -275,7 +275,7 @@ Item {
PlayerControl { PlayerControl {
type: IconButton.Text type: IconButton.Text
icon: "skip_previous" icon: "skip_previous"
font.pointSize: Math.round(Tokens.font.size.large * 1.5) font: Tokens.font.icon.builders.large.size(Math.round(Tokens.font.icon.large.pointSize * 1.5)).build()
disabled: !Players.active?.canGoPrevious disabled: !Players.active?.canGoPrevious
onClicked: Players.active?.previous() onClicked: Players.active?.previous()
} }
@ -286,7 +286,7 @@ Item {
toggle: true toggle: true
padding: Tokens.padding.extraSmall / 2 padding: Tokens.padding.extraSmall / 2
checked: Players.active?.isPlaying ?? false checked: Players.active?.isPlaying ?? false
font.pointSize: Math.round(Tokens.font.size.large * 1.5) font: Tokens.font.icon.builders.large.size(Math.round(Tokens.font.icon.large.pointSize * 1.5)).build()
disabled: !Players.active?.canTogglePlaying disabled: !Players.active?.canTogglePlaying
onClicked: Players.active?.togglePlaying() onClicked: Players.active?.togglePlaying()
} }
@ -294,7 +294,7 @@ Item {
PlayerControl { PlayerControl {
type: IconButton.Text type: IconButton.Text
icon: "skip_next" icon: "skip_next"
font.pointSize: Math.round(Tokens.font.size.large * 1.5) font: Tokens.font.icon.builders.large.size(Math.round(Tokens.font.icon.large.pointSize * 1.5)).build()
disabled: !Players.active?.canGoNext disabled: !Players.active?.canGoNext
onClicked: Players.active?.next() onClicked: Players.active?.next()
} }
@ -302,7 +302,7 @@ Item {
PlayerControl { PlayerControl {
type: IconButton.Text type: IconButton.Text
icon: "lyrics" icon: "lyrics"
font.pointSize: Math.round(Tokens.font.size.large) font: Tokens.font.icon.builders.large.size(Math.round(Tokens.font.icon.large.pointSize)).build()
onClicked: root.lyricMenuOpen = !root.lyricMenuOpen onClicked: root.lyricMenuOpen = !root.lyricMenuOpen
} }
} }
@ -356,7 +356,7 @@ Item {
text: root.lengthStr(Players.active ? Players.active.position % Players.active.length : -1) text: root.lengthStr(Players.active ? Players.active.position % Players.active.length : -1)
color: Colours.palette.m3onSurfaceVariant color: Colours.palette.m3onSurfaceVariant
font.pointSize: Tokens.font.size.small font: Tokens.font.body.small
} }
StyledText { StyledText {
@ -366,7 +366,7 @@ Item {
text: root.lengthStr(Players.active?.length ?? -1) text: root.lengthStr(Players.active?.length ?? -1)
color: Colours.palette.m3onSurfaceVariant color: Colours.palette.m3onSurfaceVariant
font.pointSize: Tokens.font.size.small font: Tokens.font.body.small
} }
} }
} }
@ -443,8 +443,8 @@ Item {
type: IconButton.Text type: IconButton.Text
icon: "move_up" icon: "move_up"
inactiveOnColour: Colours.palette.m3secondary inactiveOnColour: Colours.palette.m3secondary
padding: Tokens.padding.extraSmall padding: Tokens.padding.small
font.pointSize: Tokens.font.size.large font: Tokens.font.icon.large
disabled: !Players.active?.canRaise disabled: !Players.active?.canRaise
onClicked: { onClicked: {
Players.active?.raise(); Players.active?.raise();
@ -482,8 +482,8 @@ Item {
type: IconButton.Text type: IconButton.Text
icon: "delete" icon: "delete"
inactiveOnColour: Colours.palette.m3error inactiveOnColour: Colours.palette.m3error
padding: Tokens.padding.extraSmall padding: Tokens.padding.small
font.pointSize: Tokens.font.size.large font: Tokens.font.icon.large
disabled: !Players.active?.canQuit disabled: !Players.active?.canQuit
onClicked: Players.active?.quit() onClicked: Players.active?.quit()
} }

View file

@ -37,21 +37,21 @@ Item {
MaterialIcon { MaterialIcon {
Layout.alignment: Qt.AlignHCenter Layout.alignment: Qt.AlignHCenter
text: "tune" text: "tune"
font.pointSize: Tokens.font.size.extraLarge * 2 font: Tokens.font.icon.builders.extraLarge.size(Tokens.font.icon.extraLarge.pointSize * 2).build()
color: Colours.palette.m3onSurfaceVariant color: Colours.palette.m3onSurfaceVariant
} }
StyledText { StyledText {
Layout.alignment: Qt.AlignHCenter Layout.alignment: Qt.AlignHCenter
text: qsTr("No widgets enabled") text: qsTr("No widgets enabled")
font.pointSize: Tokens.font.size.large font: Tokens.font.body.large
color: Colours.palette.m3onSurface color: Colours.palette.m3onSurface
} }
StyledText { StyledText {
Layout.alignment: Qt.AlignHCenter Layout.alignment: Qt.AlignHCenter
text: qsTr("Enable widgets in dashboard settings") text: qsTr("Enable widgets in dashboard settings")
font.pointSize: Tokens.font.size.small font: Tokens.font.body.small
color: Colours.palette.m3onSurfaceVariant color: Colours.palette.m3onSurfaceVariant
} }
} }
@ -214,14 +214,14 @@ Item {
return charging ? `battery_charging_${(level + 3) * 10}` : `battery_${level}_bar`; return charging ? `battery_charging_${(level + 3) * 10}` : `battery_${level}_bar`;
} }
font.pointSize: Tokens.font.size.large font: Tokens.font.icon.large
color: batteryTank.accentColor color: batteryTank.accentColor
} }
StyledText { StyledText {
Layout.fillWidth: true Layout.fillWidth: true
text: qsTr("Battery") text: qsTr("Battery")
font.pointSize: Tokens.font.size.normal font: Tokens.font.body.medium
color: Colours.palette.m3onSurface color: Colours.palette.m3onSurface
} }
} }
@ -238,8 +238,7 @@ Item {
StyledText { StyledText {
Layout.alignment: Qt.AlignRight Layout.alignment: Qt.AlignRight
text: `${Math.round(batteryTank.percentage * 100)}%` text: `${Math.round(batteryTank.percentage * 100)}%`
font.pointSize: Tokens.font.size.extraLarge font: Tokens.font.body.builders.large.size(28).weight(Font.Medium).build()
font.weight: Font.Medium
color: batteryTank.accentColor color: batteryTank.accentColor
} }
@ -263,7 +262,7 @@ Item {
return `${min}m`; return `${min}m`;
} }
font.pointSize: Tokens.font.size.smaller font: Tokens.font.body.small
color: Colours.palette.m3onSurfaceVariant color: Colours.palette.m3onSurfaceVariant
} }
} }
@ -288,13 +287,13 @@ Item {
text: parent.icon text: parent.icon
fill: 1 fill: 1
color: parent.accentColor color: parent.accentColor
font.pointSize: Tokens.spacing.largeIncreased font: Tokens.font.icon.builders.medium.size(Tokens.spacing.large).build()
} }
StyledText { StyledText {
Layout.fillWidth: true Layout.fillWidth: true
text: parent.title text: parent.title
font.pointSize: Tokens.font.size.normal font: Tokens.font.body.medium
elide: Text.ElideRight elide: Text.ElideRight
} }
} }
@ -388,13 +387,12 @@ Item {
StyledText { StyledText {
text: heroCard.secondaryValue text: heroCard.secondaryValue
font.pointSize: Tokens.font.size.normal font: Tokens.font.body.builders.medium.weight(Font.Medium).build()
font.weight: Font.Medium
} }
StyledText { StyledText {
text: heroCard.secondaryLabel text: heroCard.secondaryLabel
font.pointSize: Tokens.font.size.small font: Tokens.font.body.small
color: Colours.palette.m3onSurfaceVariant color: Colours.palette.m3onSurfaceVariant
anchors.baseline: parent.children[0].baseline anchors.baseline: parent.children[0].baseline
} }
@ -423,15 +421,14 @@ Item {
anchors.right: parent.right anchors.right: parent.right
text: heroCard.mainLabel text: heroCard.mainLabel
font.pointSize: Tokens.font.size.normal font: Tokens.font.body.medium
color: Colours.palette.m3onSurfaceVariant color: Colours.palette.m3onSurfaceVariant
} }
StyledText { StyledText {
anchors.right: parent.right anchors.right: parent.right
text: heroCard.mainValue text: heroCard.mainValue
font.pointSize: Tokens.font.size.extraLarge font: Tokens.font.body.builders.large.size(28).weight(Font.Medium).build()
font.weight: Font.Medium
color: heroCard.accentColor color: heroCard.accentColor
} }
} }
@ -496,8 +493,7 @@ Item {
StyledText { StyledText {
anchors.centerIn: parent anchors.centerIn: parent
text: `${Math.round(gaugeCard.percentage * 100)}%` text: `${Math.round(gaugeCard.percentage * 100)}%`
font.pointSize: Tokens.font.size.extraLarge font: Tokens.font.body.builders.large.size(28).weight(Font.Medium).build()
font.weight: Font.Medium
color: gaugeCard.accentColor color: gaugeCard.accentColor
} }
} }
@ -505,7 +501,7 @@ Item {
StyledText { StyledText {
Layout.alignment: Qt.AlignHCenter Layout.alignment: Qt.AlignHCenter
text: gaugeCard.subtitle text: gaugeCard.subtitle
font.pointSize: Tokens.font.size.smaller font: Tokens.font.body.small
color: Colours.palette.m3onSurfaceVariant color: Colours.palette.m3onSurfaceVariant
} }
} }
@ -585,7 +581,7 @@ Item {
MaterialIcon { MaterialIcon {
text: "unfold_more" text: "unfold_more"
color: Colours.palette.m3onSurfaceVariant color: Colours.palette.m3onSurfaceVariant
font.pointSize: Tokens.font.size.normal font: Tokens.font.icon.medium
visible: storageGaugeCard.diskCount > 1 visible: storageGaugeCard.diskCount > 1
opacity: 0.7 opacity: 0.7
ToolTip.visible: hintHover.hovered ToolTip.visible: hintHover.hovered
@ -616,8 +612,7 @@ Item {
StyledText { StyledText {
anchors.centerIn: parent anchors.centerIn: parent
text: storageGaugeCard.currentDisk ? `${Math.round(storageGaugeCard.currentDisk.perc * 100)}%` : "—" text: storageGaugeCard.currentDisk ? `${Math.round(storageGaugeCard.currentDisk.perc * 100)}%` : "—"
font.pointSize: Tokens.font.size.extraLarge font: Tokens.font.body.builders.large.size(28).weight(Font.Medium).build()
font.weight: Font.Medium
color: storageGaugeCard.accentColor color: storageGaugeCard.accentColor
} }
} }
@ -632,7 +627,7 @@ Item {
const totalFmt = SystemUsage.formatKib(storageGaugeCard.currentDisk.total); const totalFmt = SystemUsage.formatKib(storageGaugeCard.currentDisk.total);
return `${usedFmt.value.toFixed(1)} / ${Math.floor(totalFmt.value)} ${totalFmt.unit}`; return `${usedFmt.value.toFixed(1)} / ${Math.floor(totalFmt.value)} ${totalFmt.unit}`;
} }
font.pointSize: Tokens.font.size.smaller font: Tokens.font.body.small
color: Colours.palette.m3onSurfaceVariant color: Colours.palette.m3onSurfaceVariant
} }
} }
@ -719,7 +714,7 @@ Item {
StyledText { StyledText {
anchors.centerIn: parent anchors.centerIn: parent
text: qsTr("Collecting data...") text: qsTr("Collecting data...")
font.pointSize: Tokens.font.size.small font: Tokens.font.body.small
color: Colours.palette.m3onSurfaceVariant color: Colours.palette.m3onSurfaceVariant
visible: NetworkUsage.downloadBuffer.count < 2 visible: NetworkUsage.downloadBuffer.count < 2
opacity: 0.6 opacity: 0.6
@ -734,12 +729,12 @@ Item {
MaterialIcon { MaterialIcon {
text: "download" text: "download"
color: Colours.palette.m3tertiary color: Colours.palette.m3tertiary
font.pointSize: Tokens.font.size.normal font: Tokens.font.icon.medium
} }
StyledText { StyledText {
text: qsTr("Download") text: qsTr("Download")
font.pointSize: Tokens.font.size.small font: Tokens.font.body.small
color: Colours.palette.m3onSurfaceVariant color: Colours.palette.m3onSurfaceVariant
} }
@ -752,8 +747,7 @@ Item {
const fmt = NetworkUsage.formatBytes(NetworkUsage.downloadSpeed ?? 0); const fmt = NetworkUsage.formatBytes(NetworkUsage.downloadSpeed ?? 0);
return fmt ? `${fmt.value.toFixed(1)} ${fmt.unit}` : "0.0 B/s"; return fmt ? `${fmt.value.toFixed(1)} ${fmt.unit}` : "0.0 B/s";
} }
font.pointSize: Tokens.font.size.normal font: Tokens.font.body.builders.medium.weight(Font.Medium).build()
font.weight: Font.Medium
color: Colours.palette.m3tertiary color: Colours.palette.m3tertiary
} }
} }
@ -766,12 +760,12 @@ Item {
MaterialIcon { MaterialIcon {
text: "upload" text: "upload"
color: Colours.palette.m3secondary color: Colours.palette.m3secondary
font.pointSize: Tokens.font.size.normal font: Tokens.font.icon.medium
} }
StyledText { StyledText {
text: qsTr("Upload") text: qsTr("Upload")
font.pointSize: Tokens.font.size.small font: Tokens.font.body.small
color: Colours.palette.m3onSurfaceVariant color: Colours.palette.m3onSurfaceVariant
} }
@ -784,8 +778,7 @@ Item {
const fmt = NetworkUsage.formatBytes(NetworkUsage.uploadSpeed ?? 0); const fmt = NetworkUsage.formatBytes(NetworkUsage.uploadSpeed ?? 0);
return fmt ? `${fmt.value.toFixed(1)} ${fmt.unit}` : "0.0 B/s"; return fmt ? `${fmt.value.toFixed(1)} ${fmt.unit}` : "0.0 B/s";
} }
font.pointSize: Tokens.font.size.normal font: Tokens.font.body.builders.medium.weight(Font.Medium).build()
font.weight: Font.Medium
color: Colours.palette.m3secondary color: Colours.palette.m3secondary
} }
} }
@ -798,12 +791,12 @@ Item {
MaterialIcon { MaterialIcon {
text: "history" text: "history"
color: Colours.palette.m3onSurfaceVariant color: Colours.palette.m3onSurfaceVariant
font.pointSize: Tokens.font.size.normal font: Tokens.font.icon.medium
} }
StyledText { StyledText {
text: qsTr("Total") text: qsTr("Total")
font.pointSize: Tokens.font.size.small font: Tokens.font.body.small
color: Colours.palette.m3onSurfaceVariant color: Colours.palette.m3onSurfaceVariant
} }
@ -817,7 +810,7 @@ Item {
const up = NetworkUsage.formatBytesTotal(NetworkUsage.uploadTotal ?? 0); const up = NetworkUsage.formatBytesTotal(NetworkUsage.uploadTotal ?? 0);
return (down && up) ? `${down.value.toFixed(1)}${down.unit} ${up.value.toFixed(1)}${up.unit}` : "↓0.0B ↑0.0B"; return (down && up) ? `${down.value.toFixed(1)}${down.unit} ${up.value.toFixed(1)}${up.unit}` : "↓0.0B ↑0.0B";
} }
font.pointSize: Tokens.font.size.small font: Tokens.font.body.small
color: Colours.palette.m3onSurfaceVariant color: Colours.palette.m3onSurfaceVariant
} }
} }

View file

@ -221,7 +221,7 @@ Item {
text: tab.iconName text: tab.iconName
color: tab.current ? Colours.palette.m3primary : Colours.palette.m3onSurfaceVariant color: tab.current ? Colours.palette.m3primary : Colours.palette.m3onSurfaceVariant
fill: tab.current ? 1 : 0 fill: tab.current ? 1 : 0
font.pointSize: Tokens.font.size.large font: Tokens.font.icon.large
Behavior on fill { Behavior on fill {
Anim {} Anim {}

View file

@ -29,14 +29,13 @@ Item {
StyledText { StyledText {
text: Weather.city || qsTr("Loading...") text: Weather.city || qsTr("Loading...")
font.pointSize: Tokens.font.size.extraLarge font: Tokens.font.body.builders.large.size(28).weight(600).build()
font.weight: 600
color: Colours.palette.m3onSurface color: Colours.palette.m3onSurface
} }
StyledText { StyledText {
text: new Date().toLocaleDateString(Qt.locale(), "dddd, MMMM d") text: new Date().toLocaleDateString(Qt.locale(), "dddd, MMMM d")
font.pointSize: Tokens.font.size.small font: Tokens.font.body.small
color: Colours.palette.m3onSurfaceVariant color: Colours.palette.m3onSurfaceVariant
} }
} }
@ -80,7 +79,7 @@ Item {
MaterialIcon { MaterialIcon {
Layout.alignment: Qt.AlignVCenter Layout.alignment: Qt.AlignVCenter
text: Weather.icon text: Weather.icon
font.pointSize: Tokens.font.size.extraLarge * 3 font: Tokens.font.icon.builders.extraLarge.size(Tokens.font.icon.extraLarge.pointSize * 3).build()
color: Colours.palette.m3secondary color: Colours.palette.m3secondary
animate: true animate: true
} }
@ -91,15 +90,14 @@ Item {
StyledText { StyledText {
text: Weather.temp text: Weather.temp
font.pointSize: Tokens.font.size.extraLarge * 2 font: Tokens.font.body.builders.large.size(28 * 2).weight(500).build()
font.weight: 500
color: Colours.palette.m3primary color: Colours.palette.m3primary
} }
StyledText { StyledText {
Layout.leftMargin: Tokens.padding.extraSmall Layout.leftMargin: Tokens.padding.extraSmall
text: Weather.description text: Weather.description
font.pointSize: Tokens.font.size.normal font: Tokens.font.body.medium
color: Colours.palette.m3onSurfaceVariant color: Colours.palette.m3onSurfaceVariant
} }
} }
@ -135,8 +133,7 @@ Item {
Layout.leftMargin: Tokens.padding.medium Layout.leftMargin: Tokens.padding.medium
visible: forecastRepeater.count > 0 visible: forecastRepeater.count > 0
text: qsTr("7-Day Forecast") text: qsTr("7-Day Forecast")
font.pointSize: Tokens.font.size.normal font: Tokens.font.body.builders.medium.weight(600).build()
font.weight: 600
color: Colours.palette.m3onSurface color: Colours.palette.m3onSurface
} }
@ -170,8 +167,7 @@ Item {
StyledText { StyledText {
Layout.alignment: Qt.AlignHCenter Layout.alignment: Qt.AlignHCenter
text: forecastItem.index === 0 ? qsTr("Today") : new Date(forecastItem.modelData.date).toLocaleDateString(Qt.locale(), "ddd") text: forecastItem.index === 0 ? qsTr("Today") : new Date(forecastItem.modelData.date).toLocaleDateString(Qt.locale(), "ddd")
font.pointSize: Tokens.font.size.normal font: Tokens.font.body.builders.medium.weight(600).build()
font.weight: 600
color: Colours.palette.m3primary color: Colours.palette.m3primary
} }
@ -179,7 +175,7 @@ Item {
Layout.topMargin: -Tokens.spacing.extraSmall Layout.topMargin: -Tokens.spacing.extraSmall
Layout.alignment: Qt.AlignHCenter Layout.alignment: Qt.AlignHCenter
text: new Date(forecastItem.modelData.date).toLocaleDateString(Qt.locale(), "MMM d") text: new Date(forecastItem.modelData.date).toLocaleDateString(Qt.locale(), "MMM d")
font.pointSize: Tokens.font.size.small font: Tokens.font.body.small
opacity: 0.7 opacity: 0.7
color: Colours.palette.m3onSurfaceVariant color: Colours.palette.m3onSurfaceVariant
} }
@ -187,14 +183,14 @@ Item {
MaterialIcon { MaterialIcon {
Layout.alignment: Qt.AlignHCenter Layout.alignment: Qt.AlignHCenter
text: forecastItem.modelData.icon text: forecastItem.modelData.icon
font.pointSize: Tokens.font.size.extraLarge font: Tokens.font.icon.extraLarge
color: Colours.palette.m3secondary color: Colours.palette.m3secondary
} }
StyledText { StyledText {
Layout.alignment: Qt.AlignHCenter Layout.alignment: Qt.AlignHCenter
text: GlobalConfig.services.useFahrenheit ? forecastItem.modelData.maxTempF + "°" + " / " + forecastItem.modelData.minTempF + "°" : forecastItem.modelData.maxTempC + "°" + " / " + forecastItem.modelData.minTempC + "°" text: GlobalConfig.services.useFahrenheit ? forecastItem.modelData.maxTempF + "°" + " / " + forecastItem.modelData.minTempF + "°" : forecastItem.modelData.maxTempC + "°" + " / " + forecastItem.modelData.minTempC + "°"
font.weight: 600 font: Tokens.font.body.builders.small.weight(600).build()
color: Colours.palette.m3tertiary color: Colours.palette.m3tertiary
} }
} }
@ -223,7 +219,7 @@ Item {
MaterialIcon { MaterialIcon {
text: detailRoot.icon text: detailRoot.icon
color: detailRoot.colour color: detailRoot.colour
font.pointSize: Tokens.font.size.large font: Tokens.font.icon.large
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
} }
@ -233,13 +229,13 @@ Item {
StyledText { StyledText {
text: detailRoot.label text: detailRoot.label
font.pointSize: Tokens.font.size.smaller font: Tokens.font.body.small
opacity: 0.7 opacity: 0.7
horizontalAlignment: Text.AlignLeft horizontalAlignment: Text.AlignLeft
} }
StyledText { StyledText {
text: detailRoot.value text: detailRoot.value
font.weight: 600 font: Tokens.font.body.builders.small.weight(600).build()
horizontalAlignment: Text.AlignLeft horizontalAlignment: Text.AlignLeft
} }
} }
@ -258,20 +254,19 @@ Item {
MaterialIcon { MaterialIcon {
text: weatherStat.icon text: weatherStat.icon
font.pointSize: Tokens.font.size.extraLarge font: Tokens.font.icon.extraLarge
color: weatherStat.colour color: weatherStat.colour
} }
Column { Column {
StyledText { StyledText {
text: weatherStat.label text: weatherStat.label
font.pointSize: Tokens.font.size.smaller font: Tokens.font.body.small
color: Colours.palette.m3onSurfaceVariant color: Colours.palette.m3onSurfaceVariant
} }
StyledText { StyledText {
text: weatherStat.value text: weatherStat.value
font.pointSize: Tokens.font.size.small font: Tokens.font.body.builders.small.weight(600).build()
font.weight: 600
color: Colours.palette.m3onSurface color: Colours.palette.m3onSurface
} }
} }