fix: font assignment in multiple components

This commit is contained in:
2026-11-07 13:39:51 +01:00
parent 1f8f1ee556
commit 4ac55b0c2e
11 changed files with 115 additions and 42 deletions
+2 -2
View File
@@ -14,7 +14,7 @@ import qs.Services
WidgetBase {
id: root
readonly property font font: Tokens.font.clock.family(Config.appearance.font.family.clock).build()
readonly property font font: Tokens.font.clock.family(Config.appearance.font.family.clock).size(Tokens.font.body.small.pointSize).build()
readonly property color contentColor: Colors.palette.m3onSurface
readonly property string effectiveFormat: {
let fmt = Config.general.dateFormat;
@@ -71,8 +71,8 @@ WidgetBase {
}
SnapLayout {
orientation: Qt.Vertical
id: verticalColumn
orientation: Qt.Vertical
anchors.centerIn: parent
spacing: Tokens.padding.extraSmall ?? 2
+1 -2
View File
@@ -73,8 +73,7 @@ Item {
anchors.topMargin: root.horizontal ? 0 : Tokens.spacing.small
anchors.verticalCenter: root.horizontal ? parent.verticalCenter : undefined
color: root.color
font.family: metrics.font.family
font.pointSize: metrics.font.pointSize
font: metrics.font
height: root.horizontal ? implicitHeight : implicitWidth
opacity: root.current === this ? 1 : 0
width: root.horizontal ? implicitWidth : implicitHeight
+9 -7
View File
@@ -19,6 +19,8 @@ Item {
readonly property int panelRadius: Tokens.rounding.largeIncreased + Tokens.padding.smaller
readonly property int rounding: panelRadius - Tokens.padding.smaller
readonly property int topMargin: 0
readonly property font valueFont: Tokens.font.body.builders.small.weight(Font.DemiBold).build()
required property var wrapper
implicitHeight: vol.implicitHeight + Tokens.padding.smaller * 2
@@ -48,7 +50,7 @@ Item {
}
component VolumesTab: SnapLayout {
orientation: Qt.Vertical
orientation: Qt.Vertical
spacing: 12
CustomRect {
@@ -59,7 +61,7 @@ orientation: Qt.Vertical
radius: root.rounding - vol.anchors.margins
SnapLayout {
orientation: Qt.Vertical
orientation: Qt.Vertical
anchors.bottomMargin: Tokens.padding.small
anchors.fill: parent
anchors.leftMargin: Tokens.padding.small
@@ -79,7 +81,7 @@ orientation: Qt.Vertical
CustomText {
Layout.alignment: Qt.AlignVCenter | Qt.AlignRight
color: Qt.alpha(Colors.palette.m3onSurface, 0.7)
font.bold: true
font: root.valueFont
text: qsTr("%1").arg(Audio.muted ? qsTr("Muted") : `${Math.round(Audio.volume * 100)}%`)
}
}
@@ -157,7 +159,7 @@ orientation: Qt.Vertical
}
SnapLayout {
orientation: Qt.Vertical
orientation: Qt.Vertical
anchors.bottomMargin: Tokens.padding.small
anchors.fill: parent
anchors.leftMargin: Tokens.padding.small
@@ -177,7 +179,7 @@ orientation: Qt.Vertical
CustomText {
Layout.alignment: Qt.AlignVCenter | Qt.AlignRight
color: Qt.alpha(Colors.palette.m3onSurface, 0.7)
font.bold: true
font: root.valueFont
text: qsTr("%1").arg(Audio.sourceMuted ? qsTr("Muted") : `${Math.round(Audio.sourceVolume * 100)}%`)
}
}
@@ -281,7 +283,7 @@ orientation: Qt.Vertical
}
SnapLayout {
orientation: Qt.Vertical
orientation: Qt.Vertical
anchors.bottomMargin: Tokens.padding.small
anchors.fill: parent
anchors.leftMargin: Tokens.padding.small
@@ -302,7 +304,7 @@ orientation: Qt.Vertical
CustomText {
Layout.alignment: Qt.AlignVCenter | Qt.AlignRight
color: Qt.alpha(Colors.palette.m3onSurface, 0.7)
font.bold: true
font: root.valueFont
text: qsTr("%1").arg(appBox.modelData.audio.muted ? qsTr("Muted") : `${Math.round(appBox.modelData.audio.volume * 100)}%`)
}
}
+2 -1
View File
@@ -112,7 +112,7 @@ Column {
CustomText {
anchors.verticalCenter: parent.verticalCenter
color: Colors.palette.m3onError
font.family: Config.appearance.font.family.mono
font: Tokens.font.mono.small
text: qsTr("Performance Degraded")
}
@@ -127,6 +127,7 @@ Column {
CustomText {
anchors.horizontalCenter: parent.horizontalCenter
color: Colors.palette.m3onError
font: Tokens.font.label.small
text: qsTr("Reason: %1").arg(PerformanceDegradationReason.toString(PowerProfiles.degradationReason))
}
}
+1 -1
View File
@@ -4,10 +4,10 @@ import Quickshell
import QtQuick
import QtQuick.Layouts
import ZShell.Components
import ZShell.Config
import qs.Modules
import qs.Components
import qs.Helpers
import ZShell.Config
import qs.Services
Item {
+5 -17
View File
@@ -7,8 +7,8 @@ import qs.Helpers
import qs.Services
SnapLayout {
orientation: Qt.Vertical
id: root
orientation: Qt.Vertical
required property int start
required property int end
@@ -67,10 +67,7 @@ orientation: Qt.Vertical
anchors.verticalCenter: parent.verticalCenter
clip: true
color: focus ? Colors.palette.m3primaryContainer : Colors.palette.m3onSurface
font.family: "Roboto"
font.letterSpacing: -0.25
font.pixelSize: 56
font.weight: 400
font: Tokens.font.body.builders.large.family("Roboto").letterSpacing(-0.25).pixelSize(56).weight(400).build()
horizontalAlignment: TextInput.AlignHCenter
text: setConfigText()
verticalAlignment: TextInput.AlignVCenter
@@ -179,10 +176,7 @@ orientation: Qt.Vertical
anchors.verticalCenter: parent.verticalCenter
clip: true
color: focus ? Colors.palette.m3primaryContainer : Colors.palette.m3onSurface
font.family: "Roboto"
font.letterSpacing: -0.25
font.pixelSize: 56
font.weight: 400
font: Tokens.font.body.builders.large.family("Roboto").letterSpacing(-0.25).pixelSize(56).weight(400).build()
horizontalAlignment: TextInput.AlignHCenter
text: setConfigText()
verticalAlignment: TextInput.AlignVCenter
@@ -290,10 +284,7 @@ orientation: Qt.Vertical
anchors.verticalCenter: parent.verticalCenter
clip: true
color: focus ? Colors.palette.m3primaryContainer : Colors.palette.m3onSurface
font.family: "Roboto"
font.letterSpacing: -0.25
font.pixelSize: 56
font.weight: 400
font: Tokens.font.body.builders.large.family("Roboto").letterSpacing(-0.25).pixelSize(56).weight(400).build()
horizontalAlignment: TextInput.AlignHCenter
text: setConfigText()
verticalAlignment: TextInput.AlignVCenter
@@ -402,10 +393,7 @@ orientation: Qt.Vertical
anchors.verticalCenter: parent.verticalCenter
clip: true
color: focus ? Colors.palette.m3primaryContainer : Colors.palette.m3onSurface
font.family: "Roboto"
font.letterSpacing: -0.25
font.pixelSize: 56
font.weight: 400
font: Tokens.font.body.builders.large.family("Roboto").letterSpacing(-0.25).pixelSize(56).weight(400).build()
horizontalAlignment: TextInput.AlignHCenter
text: setConfigText()
verticalAlignment: TextInput.AlignVCenter
+3 -5
View File
@@ -36,9 +36,7 @@ Item {
anchors.right: parent.right
anchors.top: parent.top
color: Colors.palette.m3outline
font.family: "CaskaydiaCove NF"
font.pointSize: 13
font.weight: 500
font: Tokens.font.mono.builders.small.weight(Font.DemiBold).build()
text: qsTr("%1 Chat%2").arg(list.count).arg(list.count > 1 ? "s" : "")
}
@@ -134,7 +132,7 @@ Item {
anchors.right: parent.right
anchors.margins: Tokens.padding.small
padding: 8
font.pointSize: Math.round(18 * 1.2)
font: Tokens.font.icon.builders.medium.size(Math.round(18 * 1.2)).build()
icon: root.slim ? "left_panel_open" : "add"
isRound: ChatState.fabExpanded
@@ -298,7 +296,7 @@ Item {
CustomText {
animate: true
text: fabMenuItem.modelData.name
font.capitalization: Font.Capitalize
font: Tokens.font.body.builders.small.capitalization(Font.Capitalize).build
color: Colors.palette.m3onPrimaryContainer
Layout.preferredWidth: implicitWidth