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:
@@ -7,6 +7,7 @@ import Quickshell.Widgets
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import QtQuick.Shapes
|
||||
import qs.widgets.theme
|
||||
|
||||
// Variant 6 — "Slant": breaks up the rectangular layout with angled geometry —
|
||||
// a chamfered panel, a slanted header divider and sheared row highlights.
|
||||
@@ -77,7 +78,7 @@ Scope {
|
||||
// Dim backdrop — click to dismiss.
|
||||
Rectangle {
|
||||
anchors.fill: parent
|
||||
color: "#0A0A0C"
|
||||
color: Theme.surface
|
||||
opacity: 0.55
|
||||
|
||||
MouseArea {
|
||||
@@ -107,8 +108,8 @@ Scope {
|
||||
preferredRendererType: Shape.CurveRenderer
|
||||
|
||||
ShapePath {
|
||||
fillColor: "#0F1012"
|
||||
strokeColor: "#FFD063"
|
||||
fillColor: Theme.surface
|
||||
strokeColor: Theme.accent
|
||||
strokeWidth: 2
|
||||
|
||||
startX: frame.chamfer
|
||||
@@ -153,7 +154,7 @@ Scope {
|
||||
// run out to the top and left edges to meet the straight borders.
|
||||
ShapePath {
|
||||
strokeWidth: 0
|
||||
fillColor: "#FFD063"
|
||||
fillColor: Theme.accent
|
||||
|
||||
startX: 0
|
||||
startY: frame.chamfer
|
||||
@@ -179,7 +180,7 @@ Scope {
|
||||
// bottom and right edges.
|
||||
ShapePath {
|
||||
strokeWidth: 0
|
||||
fillColor: "#FFD063"
|
||||
fillColor: Theme.accent
|
||||
|
||||
startX: panelShape.width
|
||||
startY: panelShape.height - frame.chamfer
|
||||
@@ -205,7 +206,7 @@ Scope {
|
||||
// detached from the panel by the width of the cut.
|
||||
ShapePath {
|
||||
strokeWidth: 0
|
||||
fillColor: "#FFD063"
|
||||
fillColor: Theme.accent
|
||||
|
||||
startX: panelShape.width
|
||||
startY: panelShape.height
|
||||
@@ -228,7 +229,7 @@ Scope {
|
||||
// slanted end pieces on both arms.
|
||||
ShapePath {
|
||||
strokeWidth: 0
|
||||
fillColor: "#FFD063"
|
||||
fillColor: Theme.accent
|
||||
|
||||
// inner, right end of the bottom arm
|
||||
startX: panelShape.width / 3
|
||||
@@ -277,7 +278,7 @@ Scope {
|
||||
// slanted end pieces on both arms.
|
||||
ShapePath {
|
||||
strokeWidth: 0
|
||||
fillColor: "#FFD063"
|
||||
fillColor: Theme.accent
|
||||
|
||||
// inner, bottom of the right arm
|
||||
startX: panelShape.width
|
||||
@@ -345,7 +346,7 @@ Scope {
|
||||
|
||||
ShapePath {
|
||||
strokeWidth: 0
|
||||
fillColor: "#FFD063"
|
||||
fillColor: Theme.accent
|
||||
startX: 6
|
||||
startY: 0
|
||||
PathLine {
|
||||
@@ -367,7 +368,7 @@ Scope {
|
||||
}
|
||||
ShapePath {
|
||||
strokeWidth: 0
|
||||
fillColor: "#FFD063"
|
||||
fillColor: Theme.accent
|
||||
startX: 15
|
||||
startY: 0
|
||||
PathLine {
|
||||
@@ -389,7 +390,7 @@ Scope {
|
||||
}
|
||||
ShapePath {
|
||||
strokeWidth: 0
|
||||
fillColor: "#FFD063"
|
||||
fillColor: Theme.accent
|
||||
startX: 24
|
||||
startY: 0
|
||||
PathLine {
|
||||
@@ -420,8 +421,8 @@ Scope {
|
||||
anchors.fill: parent
|
||||
verticalAlignment: TextInput.AlignVCenter
|
||||
|
||||
color: "#EEEEEE"
|
||||
font.family: "Digital-7 Mono"
|
||||
color: Theme.text
|
||||
font.family: Theme.readoutFont
|
||||
font.pointSize: 20
|
||||
font.letterSpacing: 1
|
||||
clip: true
|
||||
@@ -457,7 +458,7 @@ Scope {
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
visible: input.text.length === 0
|
||||
text: "run"
|
||||
color: "#7A7B7D"
|
||||
color: Theme.muted
|
||||
font: input.font
|
||||
}
|
||||
}
|
||||
@@ -465,8 +466,8 @@ Scope {
|
||||
|
||||
Text {
|
||||
text: model.apps.length
|
||||
color: "#7A7B7D"
|
||||
font.family: "Digital-7 Mono"
|
||||
color: Theme.muted
|
||||
font.family: Theme.readoutFont
|
||||
font.pointSize: 18
|
||||
}
|
||||
}
|
||||
@@ -489,7 +490,7 @@ Scope {
|
||||
|
||||
ShapePath {
|
||||
strokeWidth: 0
|
||||
fillColor: "#FFD063"
|
||||
fillColor: Theme.accent
|
||||
startX: divider.slant
|
||||
startY: 0
|
||||
PathLine {
|
||||
@@ -512,7 +513,7 @@ Scope {
|
||||
|
||||
ShapePath {
|
||||
strokeWidth: 0
|
||||
fillColor: "#FFD063"
|
||||
fillColor: Theme.accent
|
||||
startX: 0
|
||||
startY: divider.height
|
||||
PathLine {
|
||||
@@ -535,7 +536,7 @@ Scope {
|
||||
|
||||
ShapePath {
|
||||
strokeWidth: 0
|
||||
fillColor: "#FFD063"
|
||||
fillColor: Theme.accent
|
||||
startX: divider.width
|
||||
startY: 0
|
||||
PathLine {
|
||||
@@ -597,7 +598,7 @@ Scope {
|
||||
// Body
|
||||
ShapePath {
|
||||
strokeWidth: 0
|
||||
fillColor: "#22262C"
|
||||
fillColor: Theme.raised
|
||||
startX: appRow.shear
|
||||
startY: 0
|
||||
PathLine {
|
||||
@@ -620,7 +621,7 @@ Scope {
|
||||
// Left accent edge
|
||||
ShapePath {
|
||||
strokeWidth: 0
|
||||
fillColor: "#FFD063"
|
||||
fillColor: Theme.accent
|
||||
startX: appRow.shear
|
||||
startY: 0
|
||||
PathLine {
|
||||
@@ -655,7 +656,7 @@ Scope {
|
||||
|
||||
Text {
|
||||
text: appRow.modelData.name
|
||||
color: appRow.selected ? "#FFD063" : "#EEEEEE"
|
||||
color: appRow.selected ? Theme.accent : Theme.text
|
||||
font.pointSize: 12
|
||||
elide: Text.ElideRight
|
||||
Layout.fillWidth: true
|
||||
@@ -663,7 +664,7 @@ Scope {
|
||||
|
||||
Text {
|
||||
text: appRow.modelData.genericName || ""
|
||||
color: "#7A7B7D"
|
||||
color: Theme.muted
|
||||
font.pointSize: 10
|
||||
elide: Text.ElideRight
|
||||
Layout.maximumWidth: 220
|
||||
|
||||
Reference in New Issue
Block a user