feature (Settings): Change fonts (#2516)

This commit is contained in:
end-4
2025-11-22 15:17:34 +01:00
committed by GitHub
3 changed files with 126 additions and 7 deletions
@@ -202,14 +202,14 @@ Singleton {
font: QtObject {
property QtObject family: QtObject {
property string main: "Google Sans Flex"
property string numbers: "Google Sans Flex"
property string title: "Google Sans Flex"
property string main: Config.options.appearance.fonts.main
property string numbers: Config.options.appearance.fonts.numbers
property string title: Config.options.appearance.fonts.title
property string iconMaterial: "Material Symbols Rounded"
property string iconNerd: "JetBrains Mono NF"
property string monospace: "JetBrains Mono NF"
property string reading: "Readex Pro"
property string expressive: "Space Grotesk"
property string iconNerd: Config.options.appearance.fonts.iconNerd
property string monospace: Config.options.appearance.fonts.monospace
property string reading: Config.options.appearance.fonts.reading
property string expressive: Config.options.appearance.fonts.expressive
}
property QtObject variableAxes: QtObject {
property var main: ({
@@ -110,6 +110,15 @@ Singleton {
property JsonObject appearance: JsonObject {
property bool extraBackgroundTint: true
property int fakeScreenRounding: 2 // 0: None | 1: Always | 2: When not fullscreen
property JsonObject fonts: JsonObject {
property string main: "Google Sans Flex"
property string numbers: "Google Sans Flex"
property string title: "Google Sans Flex"
property string iconNerd: "JetBrains Mono NF"
property string monospace: "JetBrains Mono NF"
property string reading: "Readex Pro"
property string expressive: "Space Grotesk"
}
property JsonObject transparency: JsonObject {
property bool enable: false
property bool automatic: true
@@ -755,4 +755,114 @@ ContentPage {
}
}
ContentSection {
icon: "text_format"
title: Translation.tr("Fonts")
ContentSubsection {
title: Translation.tr("Main font")
tooltip: Translation.tr("Used for general UI text")
MaterialTextArea {
Layout.fillWidth: true
placeholderText: Translation.tr("Font family name (e.g., Google Sans Flex)")
text: Config.options.appearance.fonts.main
wrapMode: TextEdit.NoWrap
onTextChanged: {
Config.options.appearance.fonts.main = text;
}
}
}
ContentSubsection {
title: Translation.tr("Numbers font")
tooltip: Translation.tr("Used for displaying numbers")
MaterialTextArea {
Layout.fillWidth: true
placeholderText: Translation.tr("Font family name")
text: Config.options.appearance.fonts.numbers
wrapMode: TextEdit.NoWrap
onTextChanged: {
Config.options.appearance.fonts.numbers = text;
}
}
}
ContentSubsection {
title: Translation.tr("Title font")
tooltip: Translation.tr("Used for headings and titles")
MaterialTextArea {
Layout.fillWidth: true
placeholderText: Translation.tr("Font family name")
text: Config.options.appearance.fonts.title
wrapMode: TextEdit.NoWrap
onTextChanged: {
Config.options.appearance.fonts.title = text;
}
}
}
ContentSubsection {
title: Translation.tr("Monospace font")
tooltip: Translation.tr("Used for code and terminal")
MaterialTextArea {
Layout.fillWidth: true
placeholderText: Translation.tr("Font family name (e.g., JetBrains Mono NF)")
text: Config.options.appearance.fonts.monospace
wrapMode: TextEdit.NoWrap
onTextChanged: {
Config.options.appearance.fonts.monospace = text;
}
}
}
ContentSubsection {
title: Translation.tr("Nerd font icons")
tooltip: Translation.tr("Font used for Nerd Font icons")
MaterialTextArea {
Layout.fillWidth: true
placeholderText: Translation.tr("Font family name (e.g., JetBrains Mono NF)")
text: Config.options.appearance.fonts.iconNerd
wrapMode: TextEdit.NoWrap
onTextChanged: {
Config.options.appearance.fonts.iconNerd = text;
}
}
}
ContentSubsection {
title: Translation.tr("Reading font")
tooltip: Translation.tr("Used for reading large blocks of text")
MaterialTextArea {
Layout.fillWidth: true
placeholderText: Translation.tr("Font family name (e.g., Readex Pro)")
text: Config.options.appearance.fonts.reading
wrapMode: TextEdit.NoWrap
onTextChanged: {
Config.options.appearance.fonts.reading = text;
}
}
}
ContentSubsection {
title: Translation.tr("Expressive font")
tooltip: Translation.tr("Used for decorative/expressive text")
MaterialTextArea {
Layout.fillWidth: true
placeholderText: Translation.tr("Font family name (e.g., Space Grotesk)")
text: Config.options.appearance.fonts.expressive
wrapMode: TextEdit.NoWrap
onTextChanged: {
Config.options.appearance.fonts.expressive = text;
}
}
}
}
}