Unify font sizes through qs.Commons.Style
Themes now drive typography the same way they drive colors: one [font] base-size in shell.toml is the rem root, and every Style.font.<token> (caption, bodySmall, body, subtitle, title, heading, display, displayLarge, iconSmall, icon, iconLarge) derives from it via a fixed multiplier. Themes can also pin individual tokens for stylistic emphasis. base-size is clamped 11..13 until row-height tokens exist. Bar dimensions move to the same singleton: [bar] size-horizontal / size-vertical replace the hardcoded 26/28 in Bar.qml, exposed as Style.bar.sizeHorizontal / sizeVertical. Style.qml also resolves the fontconfig 'monospace' alias via fc-match and exposes Style.font.resolvedFamily so panels can display the concrete family. Watches ~/.config/fontconfig/fonts.conf so it tracks 'omarchy font set <name>'. The qs.Ui kit (PillButton, Dropdown, Toggle, TextField, etc.) and every first-party plugin (bar widgets, settings, menu, clipboard, emoji, polkit, notifications, osd, image-picker, dev-gallery) now bind to Style.font.* instead of pixel literals. Only three deliberate display-scale outliers remain: the notification empty-state glyph and the weather flyout's hero temperature pair, all commented. Background plugin's applyTheme IPC fast-path also pushes shell.toml to Style so theme swaps update typography and bar size without waiting for inotify debounce. Dev gallery (omarchy dev ui-preview) now ships a Typography section that renders the full scale and theme tokens live, and its summon command is fixed (omarchy-shell-ipc -> omarchy-shell).
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
import qs.Commons
|
||||
import qs.Ui
|
||||
|
||||
// Generic schema-driven settings form. The host panel passes:
|
||||
@@ -16,8 +17,8 @@ Column {
|
||||
|
||||
property var schema: []
|
||||
property var entry: ({})
|
||||
property color foregroundColor: "#cacccc"
|
||||
property string fontFamilyName: "JetBrainsMono Nerd Font"
|
||||
property color foregroundColor: Color.foreground
|
||||
property string fontFamilyName: Style.font.family
|
||||
spacing: 10
|
||||
width: parent ? parent.width : 0
|
||||
|
||||
@@ -45,7 +46,7 @@ Column {
|
||||
text: modelData && modelData.label ? modelData.label : (modelData && modelData.key ? modelData.key : "")
|
||||
color: Qt.darker(root.foregroundColor, 1.3)
|
||||
font.family: root.fontFamilyName
|
||||
font.pixelSize: 11
|
||||
font.pixelSize: Style.font.bodySmall
|
||||
font.bold: true
|
||||
visible: text !== ""
|
||||
}
|
||||
@@ -55,7 +56,7 @@ Column {
|
||||
text: modelData ? (modelData.description || "") : ""
|
||||
color: Qt.darker(root.foregroundColor, 1.6)
|
||||
font.family: root.fontFamilyName
|
||||
font.pixelSize: 10
|
||||
font.pixelSize: Style.font.caption
|
||||
wrapMode: Text.WordWrap
|
||||
width: parent.width
|
||||
}
|
||||
@@ -89,7 +90,7 @@ Column {
|
||||
width: parent.width
|
||||
foreground: root.foregroundColor
|
||||
font.family: root.fontFamilyName
|
||||
font.pixelSize: 12
|
||||
font.pixelSize: Style.font.body
|
||||
text: root.currentValue(field) === undefined ? "" : String(root.currentValue(field))
|
||||
onEditingFinished: if (fieldKey) root.fieldChanged(fieldKey, text)
|
||||
}
|
||||
@@ -101,7 +102,7 @@ Column {
|
||||
property string fieldKey: ""
|
||||
property var field: ({})
|
||||
font.family: root.fontFamilyName
|
||||
font.pixelSize: 12
|
||||
font.pixelSize: Style.font.body
|
||||
text: field && field.label ? "" : ""
|
||||
checked: !!root.currentValue(field)
|
||||
onToggled: if (fieldKey) root.fieldChanged(fieldKey, checked)
|
||||
@@ -115,7 +116,7 @@ Column {
|
||||
property var field: ({})
|
||||
width: parent.width
|
||||
font.family: root.fontFamilyName
|
||||
font.pixelSize: 12
|
||||
font.pixelSize: Style.font.body
|
||||
model: field && field.options ? field.options : []
|
||||
currentIndex: {
|
||||
var v = root.currentValue(field)
|
||||
@@ -172,7 +173,7 @@ Column {
|
||||
text: slider.value.toFixed(2)
|
||||
color: root.foregroundColor
|
||||
font.family: root.fontFamilyName
|
||||
font.pixelSize: 11
|
||||
font.pixelSize: Style.font.bodySmall
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
}
|
||||
}
|
||||
@@ -185,6 +186,6 @@ Column {
|
||||
text: "No settings."
|
||||
color: Qt.darker(root.foregroundColor, 1.5)
|
||||
font.family: root.fontFamilyName
|
||||
font.pixelSize: 11
|
||||
font.pixelSize: Style.font.bodySmall
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user