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 {
text: qsTr("Delete recording?")
font.pointSize: Tokens.font.size.large
font: Tokens.font.body.large
}
StyledText {
Layout.fillWidth: true
text: qsTr("Recording '%1' will be permanently deleted.").arg(deleteConfirmation.path)
color: Colours.palette.m3onSurfaceVariant
font.pointSize: Tokens.font.size.small
font: Tokens.font.body.small
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
}

View file

@ -37,7 +37,7 @@ StyledRect {
anchors.centerIn: parent
text: "coffee"
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 {
Layout.fillWidth: true
text: qsTr("Keep Awake")
font.pointSize: Tokens.font.size.normal
font: Tokens.font.body.medium
elide: Text.ElideRight
}
@ -56,7 +56,7 @@ StyledRect {
Layout.fillWidth: true
text: IdleInhibitor.enabled ? qsTr("Preventing sleep mode") : qsTr("Normal power management")
color: Colours.palette.m3onSurfaceVariant
font.pointSize: Tokens.font.size.small
font: Tokens.font.body.small
elide: Text.ElideRight
}
}
@ -95,7 +95,7 @@ StyledRect {
anchors.centerIn: parent
text: qsTr("Active since %1").arg(Qt.formatTime(IdleInhibitor.enabledSince, GlobalConfig.services.useTwelveHourClock ? "hh:mm a" : "hh:mm"))
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
text: "screen_record"
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 {
Layout.fillWidth: true
text: qsTr("Screen Recorder")
font.pointSize: Tokens.font.size.normal
font: Tokens.font.body.medium
elide: Text.ElideRight
}
@ -67,7 +67,7 @@ StyledRect {
Layout.fillWidth: true
text: Recorder.paused ? qsTr("Recording paused") : Recorder.running ? qsTr("Recording running") : qsTr("Recording off")
color: Colours.palette.m3onSurfaceVariant
font.pointSize: Tokens.font.size.small
font: Tokens.font.body.small
elide: Text.ElideRight
}
}
@ -203,7 +203,7 @@ StyledRect {
animate: true
text: Recorder.paused ? "PAUSED" : "REC"
color: Recorder.paused ? Colours.palette.m3onTertiary : Colours.palette.m3onError
font.family: Tokens.font.family.mono
font: Tokens.font.mono.medium
}
Behavior on implicitWidth {
@ -246,7 +246,7 @@ StyledRect {
return qsTr("Recording for %1").arg(time);
}
font.pointSize: Tokens.font.size.normal
font: Tokens.font.body.medium
}
Item {
@ -259,7 +259,7 @@ StyledRect {
toggle: true
checked: Recorder.paused
type: IconButton.Tonal
font.pointSize: Tokens.font.size.large
font: Tokens.font.icon.large
onClicked: {
Recorder.togglePause();
internalChecked = Recorder.paused;
@ -270,7 +270,7 @@ StyledRect {
icon: "stop"
inactiveColour: Colours.palette.m3error
inactiveOnColour: Colours.palette.m3onError
font.pointSize: Tokens.font.size.large
font: Tokens.font.icon.large
onClicked: Recorder.stop()
}
}

View file

@ -32,14 +32,14 @@ ColumnLayout {
MaterialIcon {
Layout.alignment: Qt.AlignVCenter
text: "list"
font.pointSize: Tokens.font.size.large
font: Tokens.font.icon.large
}
StyledText {
Layout.alignment: Qt.AlignVCenter
Layout.fillWidth: true
text: qsTr("Recordings")
font.pointSize: Tokens.font.size.normal
font: Tokens.font.body.medium
}
IconButton {
@ -62,7 +62,7 @@ ColumnLayout {
Layout.fillWidth: true
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
StyledScrollBar.vertical: StyledScrollBar {
@ -175,7 +175,7 @@ ColumnLayout {
Layout.alignment: Qt.AlignHCenter
text: "scan_delete"
color: Colours.palette.m3outline
font.pointSize: Tokens.font.size.extraLarge
font: Tokens.font.icon.extraLarge
opacity: root.props.recordingListExpanded ? 1 : 0
scale: root.props.recordingListExpanded ? 1 : 0

View file

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

View file

@ -84,7 +84,7 @@ StyledRect {
return Colours.palette.m3onError;
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.m3onSurface;
}
font.pointSize: Tokens.font.size.normal
font: Tokens.font.title.small
elide: Text.ElideRight
}