feat: fontbuilder to streamline font styling

This commit is contained in:
2026-09-30 14:23:31 +02:00
parent 2c90339c77
commit f825e4d53b
115 changed files with 1687 additions and 916 deletions
+10 -22
View File
@@ -37,19 +37,15 @@ Item {
anchors.leftMargin: root.notifCount > 0 ? 0 : -width - titleText.anchors.leftMargin
anchors.verticalCenter: parent.verticalCenter
color: Colors.palette.m3outline
font.family: "CaskaydiaCove NF"
font.pointSize: 13
font.weight: 500
font: Tokens.font.label.large
opacity: root.notifCount > 0 ? 1 : 0
text: root.notifCount
Behavior on anchors.leftMargin {
Anim {
}
Anim {}
}
Behavior on opacity {
Anim {
}
Anim {}
}
}
@@ -62,9 +58,7 @@ Item {
anchors.verticalCenter: parent.verticalCenter
color: Colors.palette.m3outline
elide: Text.ElideRight
font.family: "CaskaydiaCove NF"
font.pointSize: 13
font.weight: 500
font: Tokens.font.label.large
text: root.notifCount > 0 ? qsTr("notification%1").arg(root.notifCount === 1 ? "" : "s") : qsTr("Notifications")
}
}
@@ -86,8 +80,7 @@ Item {
opacity: root.notifCount > 0 ? 0 : 1
Behavior on opacity {
Anim {
}
Anim {}
}
sourceComponent: ColumnLayout {
spacing: 20
@@ -95,9 +88,7 @@ Item {
CustomText {
Layout.alignment: Qt.AlignHCenter
color: Colors.palette.m3outlineVariant
font.family: "CaskaydiaCove NF"
font.pointSize: 18
font.weight: 500
font: Tokens.font.headline.builders.small.width(90).build()
text: qsTr("No Notifications")
}
}
@@ -160,20 +151,17 @@ Item {
scale: root.notifCount > 0 ? 1 : 0.5
Behavior on opacity {
Anim {
}
Anim {}
}
Behavior on scale {
Anim {
}
Anim {}
}
sourceComponent: IconButton {
id: clearBtn
font.pointSize: Math.round(18 * 1.2)
font: Tokens.font.icon.large
icon: "clear_all"
padding: 8
radius: Tokens.rounding.full
isRound: true
onClicked: clearTimer.start()
@@ -13,7 +13,6 @@ CustomRect {
required property ScreenState screenState
Layout.fillWidth: true
color: Colors.tPalette.m3surfaceContainer
implicitHeight: layout.implicitHeight + layout.anchors.margins * 2
@@ -46,7 +45,7 @@ CustomRect {
anchors.horizontalCenterOffset: -0.5
anchors.verticalCenterOffset: 1.5
color: Recorder.running ? Colors.palette.m3onSecondary : Colors.palette.m3onSecondaryContainer
font.pointSize: Tokens.font.size.large
fontStyle: Tokens.font.icon.large
text: "screen_record"
}
}
@@ -58,7 +57,7 @@ CustomRect {
CustomText {
Layout.fillWidth: true
elide: Text.ElideRight
font.pointSize: Tokens.font.size.normal
font: Tokens.font.body.medium
text: qsTr("Screen Recorder")
}
@@ -66,7 +65,7 @@ CustomRect {
Layout.fillWidth: true
color: Colors.palette.m3onSurfaceVariant
elide: Text.ElideRight
font.pointSize: Tokens.font.size.small
font: Tokens.font.body.small
text: Recorder.paused ? qsTr("Recording paused") : Recorder.running ? qsTr("Recording running") : qsTr("Recording off")
}
}
@@ -126,8 +125,7 @@ CustomRect {
enabled: false
Anim {
}
Anim {}
}
Behavior on running {
SequentialAnimation {
@@ -155,8 +153,7 @@ CustomRect {
value: true
}
PropertyAction {
}
PropertyAction {}
PropertyAction {
property: "enabled"
@@ -207,8 +204,7 @@ CustomRect {
radius: Tokens.rounding.full
Behavior on implicitWidth {
Anim {
}
Anim {}
}
SequentialAnimation on opacity {
alwaysRunToEnd: true
@@ -236,13 +232,13 @@ CustomRect {
anchors.centerIn: parent
animate: true
color: Recorder.paused ? Colors.palette.m3onTertiary : Colors.palette.m3onError
font.family: Config.appearance.font.family.mono
font: Tokens.font.mono.small
text: Recorder.paused ? "PAUSED" : "REC"
}
}
CustomText {
font.pointSize: Tokens.font.size.normal
font: Tokens.font.body.medium
text: {
const elapsed = Recorder.elapsed;
@@ -266,8 +262,9 @@ CustomRect {
IconButton {
checked: Recorder.paused
font.pointSize: Tokens.font.size.large
font: Tokens.font.icon.medium
icon: Recorder.paused ? "play_arrow" : "pause"
isRound: true
isToggle: true
label.animate: true
type: IconButton.Tonal
@@ -279,8 +276,9 @@ CustomRect {
}
IconButton {
font.pointSize: Tokens.font.size.large
font: Tokens.font.icon.medium
icon: "stop"
isRound: true
inactiveColor: Colors.palette.m3error
inactiveOnColor: Colors.palette.m3onError
@@ -29,14 +29,14 @@ ColumnLayout {
MaterialIcon {
Layout.alignment: Qt.AlignVCenter
font.pointSize: Tokens.font.size.large
fontStyle: Tokens.font.icon.large
text: "list"
}
CustomText {
Layout.alignment: Qt.AlignVCenter
Layout.fillWidth: true
font.pointSize: Tokens.font.size.normal
font: Tokens.font.body.medium
text: qsTr("Recordings")
}
@@ -177,7 +177,7 @@ ColumnLayout {
Layout.alignment: Qt.AlignHCenter
Layout.preferredHeight: root.screenState.recordingListExpanded ? implicitHeight : 0
color: Colors.palette.m3outline
font.pointSize: Tokens.font.size.extraLarge
fontStyle: Tokens.font.icon.extraLarge
opacity: root.screenState.recordingListExpanded ? 1 : 0
scale: root.screenState.recordingListExpanded ? 1 : 0
text: "scan_delete"
@@ -53,7 +53,7 @@ CustomRect {
spacing: Tokens.spacing.medium
CustomText {
font.pointSize: Tokens.font.size.normal
font: Tokens.font.body.medium
text: qsTr("Quick Toggles")
}
@@ -15,8 +15,7 @@ CustomRect {
radius: Tokens.rounding.small
Behavior on implicitHeight {
Anim {
}
Anim {}
}
RowLayout {
@@ -39,7 +38,7 @@ CustomRect {
anchors.centerIn: parent
color: IdleInhibitor.enabled ? Colors.palette.m3onSecondary : Colors.palette.m3onSecondaryContainer
font.pointSize: 18
fontStyle: Tokens.font.icon.large
text: "coffee"
}
}
@@ -51,7 +50,7 @@ CustomRect {
CustomText {
Layout.fillWidth: true
elide: Text.ElideRight
font.pointSize: 13
font: Tokens.font.body.medium
text: qsTr("Keep Awake")
}
@@ -59,7 +58,7 @@ CustomRect {
Layout.fillWidth: true
color: Colors.palette.m3onSurfaceVariant
elide: Text.ElideRight
font.pointSize: 11
font: Tokens.font.body.small
text: IdleInhibitor.enabled ? qsTr("Preventing sleep mode") : qsTr("Normal power management")
}
}
@@ -83,16 +82,13 @@ CustomRect {
scale: IdleInhibitor.enabled ? 1 : 0.5
Behavior on anchors.bottomMargin {
Anim {
}
Anim {}
}
Behavior on opacity {
Anim {
}
Anim {}
}
Behavior on scale {
Anim {
}
Anim {}
}
sourceComponent: CustomRect {
color: Colors.palette.m3primary
@@ -105,7 +101,7 @@ CustomRect {
anchors.centerIn: parent
color: Colors.palette.m3onPrimary
font.pointSize: Math.round(11 * 0.9)
font: Tokens.font.body.builders.small.size(Math.round(Tokens.font.body.small.pointSize * 0.9)).build()
text: qsTr("Active since %1").arg(Qt.formatTime(IdleInhibitor.enabledSince, Config.services.useTwelveHourClock ? "hh:mm a" : "hh:mm"))
}
}