Rearrange common tokens

This commit is contained in:
Ryan Hughes
2026-05-19 16:06:48 -04:00
parent 6f72604f2c
commit b45795127d
8 changed files with 51 additions and 39 deletions
+1
View File
@@ -65,6 +65,7 @@ QtObject {
}
readonly property QtObject popups: QtObject {
property color background: root.composed("popups.background", "popups.background-alpha", root.background, 1.0)
property color text: root.pick("popups.text", root.foreground)
property color border: root.composed("popups.border", "popups.border-alpha", root.pick("notifications.border", root.accent), 1.0)
}
readonly property QtObject tooltip: QtObject {
+7 -4
View File
@@ -372,10 +372,10 @@ QtObject {
}
// Parse [font] base-size + per-token overrides, [bar] size-* keys,
// [style] state colors / alphas / border widths, and [spacing] scale +
// [controls] state colors / alphas / border widths, and [spacing] scale +
// token overrides out of shell.toml. Color.qml owns the quoted-string
// side of the surface color sections; Style owns quoted strings only
// inside [style].
// inside [controls].
function loadShell(raw) {
var fontOut = {}
var barOut = {}
@@ -393,7 +393,7 @@ QtObject {
var sectionMatch = line.match(/^\[([A-Za-z0-9_-]+)\]\s*(#.*)?$/)
if (sectionMatch) { section = sectionMatch[1]; continue }
// Accept ints/floats for numeric tokens and quoted/bare words for
// [style] color roles / inheritance sentinels (e.g. "foreground",
// [controls] color roles / inheritance sentinels (e.g. "foreground",
// "accent", "hover-cursor", "#c0caf5").
var numKv = line.match(/^([A-Za-z0-9_-]+)\s*=\s*(-?\d+(?:\.\d+)?)\s*(#.*)?$/)
var stringKv = line.match(/^([A-Za-z0-9_-]+)\s*=\s*["']([^"']+)["']\s*(#.*)?$/)
@@ -412,7 +412,10 @@ QtObject {
var fval = parseFloat(rawValue)
if (key === "scale") nextSpacingScale = fval
else spacingOut[key] = fval
} else if (section === "style") {
} else if (section === "controls" || section === "style") {
// `[controls]` is the canonical section name; `[style]` is kept
// as a legacy alias so hand-written theme shell.toml files that
// predate the rename still apply.
styleOut[key] = numKv ? parseFloat(rawValue) : rawValue
}
}
+1 -1
View File
@@ -13,7 +13,7 @@ import qs.Commons
// idle transparent or normal border if `bordered`
//
// All fills/borders come from `qs.Commons.Style` tokens, so themes
// control the look via [style] in shell.toml.
// control the look via [controls] in shell.toml.
//
// Emits `hovered(bool)` so panels with their own keyboard cursor model
// can update state on mouse enter/leave.
+1 -1
View File
@@ -22,7 +22,7 @@ Item {
property string value: ""
property var options: []
property color foreground: Color.foreground
property color foreground: Color.popups.text
property color background: Color.popups.background
property color popupBorder: Color.popups.border
property color accent: Color.accent
+1 -1
View File
@@ -25,7 +25,7 @@ Item {
property string emptyText: "No matches"
property string triggerLabel: ""
property color foreground: Color.foreground
property color foreground: Color.popups.text
property color background: Color.popups.background
property color popupBorder: Color.popups.border
property color accent: Color.accent
+3 -3
View File
@@ -107,14 +107,14 @@ Item {
text: root.icon
font.family: Style.font.family
font.pixelSize: Style.font.displayLarge
color: Color.foreground
color: Color.popups.text
}
Rectangle {
visible: root.hasProgress
width: visible ? Style.space(142) : 0
height: Math.max(Style.space(6), Style.spacing.sm)
anchors.verticalCenter: parent.verticalCenter
color: Color.alpha(Color.foreground, 0.45)
color: Color.alpha(Color.popups.text, 0.45)
Rectangle {
height: parent.height
width: parent.width * (root.hasProgress ? root.value / root.maxValue : 0)
@@ -128,7 +128,7 @@ Item {
font.family: Style.font.family
font.bold: true
font.pixelSize: Style.font.title
color: Color.foreground
color: Color.popups.text
elide: Text.ElideRight
maximumLineCount: 1
clip: true