feat: fontbuilder to streamline font styling
C++ / fmt (pull_request) Failing after 4s
C++ / build (pull_request) Failing after 9s
C++ / clang-tidy (pull_request) Failing after 9s
JS/TS / fmt (pull_request) Successful in 10s
JS/TS / lint (pull_request) Successful in 9s
Python / static (pull_request) Successful in 34s
Rust / build (pull_request) Successful in 1m10s
Python / verify (pull_request) Successful in 1m53s
Rust / fmt (pull_request) Successful in 34s
Rust / clippy (pull_request) Successful in 57s

This commit is contained in:
2026-09-21 15:37:45 +02:00
parent 84d5abcaab
commit 25bee293b0
134 changed files with 1813 additions and 1011 deletions
@@ -40,8 +40,7 @@ Item {
IconButton {
enabled: false
icon: `${root.message.activeGenerationIndex + 1}`
label.font.family: Config.appearance.font.family.sans
label.font.pointSize: Tokens.font.size.small
label.font: Tokens.font.label.small
type: IconButton.Text
}
@@ -10,7 +10,7 @@ TextEditBase {
color: Colors.palette.m3onSurface
readOnly: true
textFormat: Text.MarkdownText
font.pointSize: Tokens.font.size.smaller
font: Tokens.font.body.small
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
onLinkActivated: link => {
@@ -32,8 +32,7 @@ CustomRect {
function onHighlightSpans(token, spans) {
if (token !== root.highlightToken)
return;
if (root.code !== root.requestedCode ||
root.language !== root.requestedLanguage)
if (root.code !== root.requestedCode || root.language !== root.requestedLanguage)
return;
html = spans.length ? root.highlightedHtml(root.code, spans) : "";
colored = root.visible && html.length > 0;
@@ -84,15 +83,13 @@ CustomRect {
// whitespace kept, mid-line runs collapsed, tabs as single spaces) so the
// plain and colored layouts are identical.
function plainForDisplay(code): string {
return code.split("\n")
.map(line => {
const i = line.search(/\S/);
if (i < 0)
return "";
const lead = line.slice(0, i).replace(/\t/g, " ");
return lead + line.slice(i).replace(/\s+/g, " ").replace(/\s+$/, "");
})
.join("\n");
return code.split("\n").map(line => {
const i = line.search(/\S/);
if (i < 0)
return "";
const lead = line.slice(0, i).replace(/\t/g, " ");
return lead + line.slice(i).replace(/\s+/g, " ").replace(/\s+$/, "");
}).join("\n");
}
function highlightedHtml(code, spans): string {
@@ -136,7 +133,7 @@ CustomRect {
refreshTimer.restart();
}
onVisibleChanged: if (root.visible)
refreshTimer.restart();
refreshTimer.restart()
Timer {
id: refreshTimer
@@ -223,7 +220,7 @@ CustomRect {
Layout.alignment: Qt.AlignVCenter
color: root.codeHeaderColor
font.pointSize: Tokens.font.size.small
font: Tokens.font.label.small
text: CodeIcons.name(root.language)
visible: root.language.length > 0
}
@@ -289,8 +286,7 @@ CustomRect {
color: CodeColors.active.normal
layer.enabled: true
clip: false
font.family: Config.appearance.font.family.mono
font.pointSize: Tokens.font.size.small
font: Tokens.font.mono.small
textFormat: root.colored ? Text.RichText : Text.PlainText
text: root.colored ? root.html : root.plainForDisplay(root.code)
readOnly: true
@@ -85,7 +85,7 @@ Item {
animateCursor: false
color: root.isUser ? Colors.palette.m3onPrimary : Colors.palette.m3onSurface
cursor.color: root.isUser ? Colors.palette.m3onPrimary : Colors.palette.m3primary
font.pointSize: Tokens.font.size.smaller
font: Tokens.font.body.small
readOnly: true
selectionColor: Qt.alpha((root.isUser ? Colors.palette.m3onPrimary : Colors.palette.m3primary), 0.4)
text: root.isUser ? root.segment.text : ""
@@ -5,28 +5,28 @@ import qs.Components
import qs.Services
ColumnLayout {
id: root
id: root
spacing: Tokens.spacing.small
spacing: Tokens.spacing.small
Item {
Layout.fillHeight: true
}
Item {
Layout.fillHeight: true
}
MaterialIcon {
Layout.alignment: Qt.AlignHCenter
color: Colors.tPalette.m3outlineVariant
font.pointSize: 36
text: "chat"
}
MaterialIcon {
Layout.alignment: Qt.AlignHCenter
color: Colors.tPalette.m3outlineVariant
fontStyle: Tokens.font.icon.large
text: "chat"
}
CustomText {
Layout.alignment: Qt.AlignHCenter
color: Colors.tPalette.m3onSurfaceVariant
text: qsTr("Send a message to get started")
}
CustomText {
Layout.alignment: Qt.AlignHCenter
color: Colors.tPalette.m3onSurfaceVariant
text: qsTr("Send a message to get started")
}
Item {
Layout.fillHeight: true
}
Item {
Layout.fillHeight: true
}
}
@@ -93,7 +93,7 @@ Item {
Layout.fillWidth: true
font.pointSize: Tokens.font.size.large
font: Tokens.font.title.large
elide: CustomText.ElideRight
color: Colors.palette.m3onErrorContainer
@@ -120,7 +120,7 @@ Item {
isRound: true
icon: "close"
type: IconButton.Text
font.pointSize: Tokens.font.size.large
font: Tokens.font.icon.medium
onClicked: exitAnim.start()
}
@@ -62,13 +62,12 @@ Column {
text: modelData.text
textFormat: Text.MarkdownText
readOnly: true
font.bold: true
font.pointSize: {
font: {
if (modelData.level <= 1)
return Tokens.font.size.large;
return Tokens.font.headline.builders.small.weight(Font.Bold).build();
if (modelData.level === 2)
return Tokens.font.size.normal;
return Tokens.font.size.smaller;
return Tokens.font.headline.builders.small.size(18).weight(Font.DemiBold).build();
return Tokens.font.body.medium;
}
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
}
@@ -39,8 +39,7 @@ Item {
anchors.centerIn: parent
color: root.mathColor
font.family: Config.appearance.font.family.mono
font.pointSize: Tokens.font.size.small
font: Tokens.font.mono.small
text: root.latex
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
visible: !math.ok
@@ -231,7 +231,7 @@ MouseArea {
MaterialIcon {
anchors.centerIn: parent
font.pointSize: Tokens.font.size.extraLarge
fontStyle: Tokens.font.icon.large
text: thumb.fileIcon(thumb.modelData?.mimeType ?? "")
visible: !thumb.modelData?.isImage ?? false
}
@@ -70,7 +70,7 @@ Item {
IconButton {
id: expandBtn
font.pointSize: Tokens.font.size.large
font: Tokens.font.icon.medium
icon: "keyboard_arrow_down"
inactiveOnColor: hovered ? Colors.palette.m3onSurface : Colors.palette.m3outline
anchors.centerIn: parent
@@ -91,7 +91,6 @@ Item {
id: collapsedText
color: Colors.palette.m3outline
font.pointSize: Tokens.font.size.small
Layout.fillWidth: true
Layout.leftMargin: Tokens.spacing.medium
text: {
@@ -139,7 +138,7 @@ Item {
CustomText {
id: requestHeader
text: qsTr("Tool call request")
font.pointSize: Tokens.font.size.large
font: Tokens.font.headline.medium
color: Colors.palette.m3onSurface
}
@@ -420,7 +419,7 @@ Item {
IconButton {
id: toolExpandBtn
font.pointSize: Tokens.font.size.large
font: Tokens.font.icon.medium
icon: "keyboard_arrow_down"
inactiveOnColor: hovered ? Colors.palette.m3onSurface : Colors.palette.m3outline
rotation: toolCall.expanded ? 180 : 0
@@ -609,7 +608,6 @@ Item {
anchors.topMargin: Tokens.spacing.small
anchors.right: parent.right
color: Colors.palette.m3outline
font.pointSize: Tokens.font.size.small
wrapMode: CustomText.WrapAtWordBoundaryOrAnywhere
text: segment.modelData.type === LlmSegment.Type.Reasoning ? segment.modelData.text : qsTr("%1 %2").arg(content.prettyTool(segment.modelData)).arg(content.toolTarget(segment.modelData))
}