refactor: migrate utilities to new font API

This commit is contained in:
2 * r + 2 * t 2026-04-21 01:03:44 +10:00
parent be357343ff
commit f639b04310
6 changed files with 20 additions and 20 deletions

View file

@ -168,14 +168,14 @@ Loader {
StyledText { StyledText {
text: qsTr("Delete recording?") text: qsTr("Delete recording?")
font.pointSize: Tokens.font.size.large font: Tokens.font.body.large
} }
StyledText { StyledText {
Layout.fillWidth: true Layout.fillWidth: true
text: qsTr("Recording '%1' will be permanently deleted.").arg(deleteConfirmation.path) text: qsTr("Recording '%1' will be permanently deleted.").arg(deleteConfirmation.path)
color: Colours.palette.m3onSurfaceVariant color: Colours.palette.m3onSurfaceVariant
font.pointSize: Tokens.font.size.small font: Tokens.font.body.small
wrapMode: Text.WrapAtWordBoundaryOrAnywhere wrapMode: Text.WrapAtWordBoundaryOrAnywhere
} }

View file

@ -37,7 +37,7 @@ StyledRect {
anchors.centerIn: parent anchors.centerIn: parent
text: "coffee" text: "coffee"
color: IdleInhibitor.enabled ? Colours.palette.m3onSecondary : Colours.palette.m3onSecondaryContainer color: IdleInhibitor.enabled ? Colours.palette.m3onSecondary : Colours.palette.m3onSecondaryContainer
font.pointSize: Tokens.font.size.large font: Tokens.font.icon.large
} }
} }
@ -48,7 +48,7 @@ StyledRect {
StyledText { StyledText {
Layout.fillWidth: true Layout.fillWidth: true
text: qsTr("Keep Awake") text: qsTr("Keep Awake")
font.pointSize: Tokens.font.size.normal font: Tokens.font.body.medium
elide: Text.ElideRight elide: Text.ElideRight
} }
@ -56,7 +56,7 @@ StyledRect {
Layout.fillWidth: true Layout.fillWidth: true
text: IdleInhibitor.enabled ? qsTr("Preventing sleep mode") : qsTr("Normal power management") text: IdleInhibitor.enabled ? qsTr("Preventing sleep mode") : qsTr("Normal power management")
color: Colours.palette.m3onSurfaceVariant color: Colours.palette.m3onSurfaceVariant
font.pointSize: Tokens.font.size.small font: Tokens.font.body.small
elide: Text.ElideRight elide: Text.ElideRight
} }
} }
@ -95,7 +95,7 @@ StyledRect {
anchors.centerIn: parent anchors.centerIn: parent
text: qsTr("Active since %1").arg(Qt.formatTime(IdleInhibitor.enabledSince, GlobalConfig.services.useTwelveHourClock ? "hh:mm a" : "hh:mm")) text: qsTr("Active since %1").arg(Qt.formatTime(IdleInhibitor.enabledSince, GlobalConfig.services.useTwelveHourClock ? "hh:mm a" : "hh:mm"))
color: Colours.palette.m3onPrimary color: Colours.palette.m3onPrimary
font.pointSize: Math.round(Tokens.font.size.small * 0.9) font: Tokens.font.body.builders.small.size(Math.round(Tokens.font.body.small.pointSize * 0.9)).build()
} }
} }

View file

@ -48,7 +48,7 @@ StyledRect {
anchors.verticalCenterOffset: 1.5 anchors.verticalCenterOffset: 1.5
text: "screen_record" text: "screen_record"
color: Recorder.running ? Colours.palette.m3onSecondary : Colours.palette.m3onSecondaryContainer color: Recorder.running ? Colours.palette.m3onSecondary : Colours.palette.m3onSecondaryContainer
font.pointSize: Tokens.font.size.large font: Tokens.font.icon.large
} }
} }
@ -59,7 +59,7 @@ StyledRect {
StyledText { StyledText {
Layout.fillWidth: true Layout.fillWidth: true
text: qsTr("Screen Recorder") text: qsTr("Screen Recorder")
font.pointSize: Tokens.font.size.normal font: Tokens.font.body.medium
elide: Text.ElideRight elide: Text.ElideRight
} }
@ -67,7 +67,7 @@ StyledRect {
Layout.fillWidth: true Layout.fillWidth: true
text: Recorder.paused ? qsTr("Recording paused") : Recorder.running ? qsTr("Recording running") : qsTr("Recording off") text: Recorder.paused ? qsTr("Recording paused") : Recorder.running ? qsTr("Recording running") : qsTr("Recording off")
color: Colours.palette.m3onSurfaceVariant color: Colours.palette.m3onSurfaceVariant
font.pointSize: Tokens.font.size.small font: Tokens.font.body.small
elide: Text.ElideRight elide: Text.ElideRight
} }
} }
@ -203,7 +203,7 @@ StyledRect {
animate: true animate: true
text: Recorder.paused ? "PAUSED" : "REC" text: Recorder.paused ? "PAUSED" : "REC"
color: Recorder.paused ? Colours.palette.m3onTertiary : Colours.palette.m3onError color: Recorder.paused ? Colours.palette.m3onTertiary : Colours.palette.m3onError
font.family: Tokens.font.family.mono font: Tokens.font.mono.medium
} }
Behavior on implicitWidth { Behavior on implicitWidth {
@ -246,7 +246,7 @@ StyledRect {
return qsTr("Recording for %1").arg(time); return qsTr("Recording for %1").arg(time);
} }
font.pointSize: Tokens.font.size.normal font: Tokens.font.body.medium
} }
Item { Item {
@ -259,7 +259,7 @@ StyledRect {
toggle: true toggle: true
checked: Recorder.paused checked: Recorder.paused
type: IconButton.Tonal type: IconButton.Tonal
font.pointSize: Tokens.font.size.large font: Tokens.font.icon.large
onClicked: { onClicked: {
Recorder.togglePause(); Recorder.togglePause();
internalChecked = Recorder.paused; internalChecked = Recorder.paused;
@ -270,7 +270,7 @@ StyledRect {
icon: "stop" icon: "stop"
inactiveColour: Colours.palette.m3error inactiveColour: Colours.palette.m3error
inactiveOnColour: Colours.palette.m3onError inactiveOnColour: Colours.palette.m3onError
font.pointSize: Tokens.font.size.large font: Tokens.font.icon.large
onClicked: Recorder.stop() onClicked: Recorder.stop()
} }
} }

View file

@ -32,14 +32,14 @@ ColumnLayout {
MaterialIcon { MaterialIcon {
Layout.alignment: Qt.AlignVCenter Layout.alignment: Qt.AlignVCenter
text: "list" text: "list"
font.pointSize: Tokens.font.size.large font: Tokens.font.icon.large
} }
StyledText { StyledText {
Layout.alignment: Qt.AlignVCenter Layout.alignment: Qt.AlignVCenter
Layout.fillWidth: true Layout.fillWidth: true
text: qsTr("Recordings") text: qsTr("Recordings")
font.pointSize: Tokens.font.size.normal font: Tokens.font.body.medium
} }
IconButton { IconButton {
@ -62,7 +62,7 @@ ColumnLayout {
Layout.fillWidth: true Layout.fillWidth: true
Layout.rightMargin: -Tokens.spacing.small Layout.rightMargin: -Tokens.spacing.small
implicitHeight: (Tokens.font.size.larger + Tokens.padding.extraSmall) * (root.props.recordingListExpanded ? 10 : 3) implicitHeight: (Tokens.font.body.large.pointSize + Tokens.padding.small) * (root.props.recordingListExpanded ? 10 : 3)
clip: true clip: true
StyledScrollBar.vertical: StyledScrollBar { StyledScrollBar.vertical: StyledScrollBar {
@ -175,7 +175,7 @@ ColumnLayout {
Layout.alignment: Qt.AlignHCenter Layout.alignment: Qt.AlignHCenter
text: "scan_delete" text: "scan_delete"
color: Colours.palette.m3outline color: Colours.palette.m3outline
font.pointSize: Tokens.font.size.extraLarge font: Tokens.font.icon.extraLarge
opacity: root.props.recordingListExpanded ? 1 : 0 opacity: root.props.recordingListExpanded ? 1 : 0
scale: root.props.recordingListExpanded ? 1 : 0 scale: root.props.recordingListExpanded ? 1 : 0

View file

@ -52,7 +52,7 @@ StyledRect {
StyledText { StyledText {
text: qsTr("Quick Toggles") text: qsTr("Quick Toggles")
font.pointSize: Tokens.font.size.normal font: Tokens.font.body.medium
} }
QuickToggleRow { QuickToggleRow {

View file

@ -84,7 +84,7 @@ StyledRect {
return Colours.palette.m3onError; return Colours.palette.m3onError;
return Colours.palette.m3onSurfaceVariant; return Colours.palette.m3onSurfaceVariant;
} }
font.pointSize: Math.round(Tokens.font.size.large * 1.2) font: Tokens.font.icon.builder.size(Math.round(Tokens.font.icon.large.pointSize * 1.2)).build()
} }
} }
@ -106,7 +106,7 @@ StyledRect {
return Colours.palette.m3onErrorContainer; return Colours.palette.m3onErrorContainer;
return Colours.palette.m3onSurface; return Colours.palette.m3onSurface;
} }
font.pointSize: Tokens.font.size.normal font: Tokens.font.title.small
elide: Text.ElideRight elide: Text.ElideRight
} }