refactor(quickshell): move every color and font into a Theme singleton

The shell was running two unrelated palettes: an amber one (#FFD063 accent,
#EEEEEE text, #0F1012 panels) hardcoded as ~200 raw hex literals across the
launchers, sidebar, systray, vitals and notifications, and an orange one
(#e8722a) that only the dense bar had, tokenized as per-file properties.

This unifies on the ORANGE values under the AMBER naming scheme, and moves the
lot into widgets/theme/Theme.qml. `surface` takes the dense bar's void
(#0a0a0a) rather than the old panel background. Zero color and font literals
remain anywhere under widgets/ outside Theme.qml.

Collisions resolved, all near-duplicates that wanted to be one token:
  - #0F1012 + #0A0A0C + #0a0a0a -> surface
  - #EEEEEE + #dedede           -> text
  - #7A7B7D + #858585           -> muted
  - #292C30 + #22262C           -> raised
  - #FFD063 + #e8722a           -> accent

Two derived things rather than literals. accentSoft (the pale flash the
top/bottom bars show while a launcher is open) was a hand-picked #FFF3C0
against amber, which is simply wrong against orange; it is now
Qt.tint(accent, white 55%), a ratio checked against the original (amber tinted
55% gives #FFE9B8 vs the hand-picked #FFF3C0). And the dense bar had been
hand-encoding Qt.rgba(0.87,0.87,0.87,a) and Qt.rgba(0.91,0.45,0.16,a), which
are just text and accent at alpha -- now textAlpha(a)/accentAlpha(a), so they
track a palette change instead of silently drifting.

Fonts came along too. Digital-7 Mono is dropped for DepartureMono: it was
never packaged, relying on a manual ~/.dots/fonts/digital_7 install that does
not exist on terra, so `fc-match "Digital-7 Mono"` resolved to DejaVu Sans and
all 38 of those sites -- the launcher lists, sidebar clock, systray labels,
every vitals readout -- were silently rendering in a PROPORTIONAL fallback.
Numeric columns should visibly improve. readoutFont is an alias of displayFont
rather than a second literal so the two roles cannot drift apart.

quickshell/CLAUDE.md updated: it said "No shared theme/tokens file yet" and
told contributors to grep for the existing hex color, which would now
reintroduce exactly what this removes.

Verified: no file references Theme. without the import, none imports it
unused, and the whole shell -- launchers, sidebar, vitals, systray,
notifications, not just the harness -- hot-reloaded clean on terra.
tests/HeadlessSmoke.qml deliberately keeps its own copies; its value is having
no dependencies.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SgcWkm3t6BDQktYHQvb8Hx
This commit is contained in:
2026-08-28 07:56:25 +02:00
co-authored by Claude Opus 5
parent 01bc169180
commit b16cc93ff6
22 changed files with 390 additions and 323 deletions
@@ -2,16 +2,13 @@ pragma ComponentBehavior: Bound
import QtQuick
import QtQuick.Shapes
import qs.widgets.theme
// Chamfered panel chrome for the dense status rail: outline, corner accent
// lines, and the optional header strip (id chip / title / meta / tick marks).
// Content is supplied as children by the call site.
//
// Palette and fonts are properties with defaults rather than references to the
// parent, because a component in its own file has no access to the enclosing
// scope. The defaults match DenseBarContent's, which is the repo's existing
// per-component convention (see quickshell/CLAUDE.md) — a shared theme
// singleton would be the place to collapse the duplication.
// Colors and fonts both come from the Theme singleton.
Item {
id: panel
@@ -23,22 +20,14 @@ Item {
property int offsetY: 2
property int accentLineThickness: 3
property color voidColor: "#0a0a0a"
property color inkColor: "#dedede"
property color mutedColor: "#858585"
property color accentColor: "#e8722a"
property color hairColor: Qt.rgba(0.87, 0.87, 0.87, 0.28)
property string displayFont: "DepartureMono Nerd Font"
property string microFont: "DejaVu Sans Mono"
Shape {
id: panelShape
anchors.fill: parent
preferredRendererType: Shape.CurveRenderer
ShapePath {
fillColor: panel.voidColor
strokeColor: panel.hairColor
fillColor: Theme.surface
strokeColor: Theme.hair
strokeWidth: 1
startX: 0; startY: panel.offsetY
PathLine { x: panelShape.width - panel.chamfer; y: panel.offsetY }
@@ -51,7 +40,7 @@ Item {
// Upper left accent line
ShapePath {
fillColor: panel.accentColor
fillColor: Theme.accent
strokeWidth: 0
startX: 0; startY: 0
PathLine { x: Math.min(49, panelShape.width / 3); y: 0 }
@@ -62,7 +51,7 @@ Item {
// Lower right accent line
ShapePath {
fillColor: panel.accentColor
fillColor: Theme.accent
strokeWidth: 0
startX: panelShape.width; startY: panelShape.height
PathLine { x: panelShape.width - Math.min(49, panelShape.width / 3); y: panelShape.height }
@@ -77,7 +66,7 @@ Item {
x: 1; y: 22
width: parent.width - 2
height: 1
color: panel.inkColor
color: Theme.text
opacity: 0.12
}
@@ -86,12 +75,12 @@ Item {
x: 5; y: 7
width: panel.panelId.length > 2 ? 29 : 24
height: 11
color: panel.accentColor
color: Theme.accent
Text {
anchors.centerIn: parent
text: panel.panelId
color: panel.voidColor
font.family: panel.microFont
color: Theme.surface
font.family: Theme.microFont
font.pixelSize: 8
font.bold: true
}
@@ -102,8 +91,8 @@ Item {
x: 40; y: 7
width: parent.width - 105
text: panel.title
color: panel.inkColor
font.family: panel.displayFont
color: Theme.text
font.family: Theme.displayFont
font.pixelSize: 9
font.bold: true
font.letterSpacing: 1.1
@@ -119,8 +108,8 @@ Item {
y: 6
text: panel.meta
width: Math.min(80, parent.width / 4)
color: panel.mutedColor
font.family: panel.microFont
color: Theme.muted
font.family: Theme.microFont
font.pixelSize: 6
font.letterSpacing: 0.7
horizontalAlignment: Text.AlignRight
@@ -135,7 +124,7 @@ Item {
spacing: 2
Repeater {
model: 5
Rectangle { required property int index; width: 4; height: 2; color: panel.accentColor }
Rectangle { required property int index; width: 4; height: 2; color: Theme.accent }
}
}
}