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:
@@ -8,6 +8,7 @@ import Quickshell.Widgets
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import QtQuick.Shapes
|
||||
import qs.widgets.theme
|
||||
|
||||
// A vertical sidebar carrying the "Slant" (launcher V6) visual language —
|
||||
// chamfered panel, thick trapezoid bevel accents, an outward bracket, a
|
||||
@@ -81,8 +82,8 @@ Scope {
|
||||
// Panel: big chamfers on top-right & bottom-left, small bevels
|
||||
// on top-left & bottom-right (mirror of the left-anchored panel).
|
||||
ShapePath {
|
||||
fillColor: "#0F1012"
|
||||
strokeColor: "#FFD063"
|
||||
fillColor: Theme.surface
|
||||
strokeColor: Theme.accent
|
||||
strokeWidth: 2
|
||||
|
||||
startX: panelShape.width - frame.chamfer
|
||||
@@ -124,7 +125,7 @@ Scope {
|
||||
// Thick top-right bevel accent (trapezoid to the edges).
|
||||
ShapePath {
|
||||
strokeWidth: 0
|
||||
fillColor: "#FFD063"
|
||||
fillColor: Theme.accent
|
||||
|
||||
startX: panelShape.width
|
||||
startY: frame.chamfer
|
||||
@@ -149,7 +150,7 @@ Scope {
|
||||
// Thick bottom-left bevel accent.
|
||||
ShapePath {
|
||||
strokeWidth: 0
|
||||
fillColor: "#FFD063"
|
||||
fillColor: Theme.accent
|
||||
|
||||
startX: 0
|
||||
startY: panelShape.height - frame.chamfer
|
||||
@@ -174,7 +175,7 @@ Scope {
|
||||
// Floating triangle cap in the bottom-left notch.
|
||||
ShapePath {
|
||||
strokeWidth: 0
|
||||
fillColor: "#FFD063"
|
||||
fillColor: Theme.accent
|
||||
|
||||
startX: 0
|
||||
startY: panelShape.height
|
||||
@@ -197,7 +198,7 @@ Scope {
|
||||
// corner following the small chamfer.
|
||||
ShapePath {
|
||||
strokeWidth: 0
|
||||
fillColor: "#FFD063"
|
||||
fillColor: Theme.accent
|
||||
|
||||
startX: 0
|
||||
startY: frame.armSide
|
||||
@@ -245,15 +246,15 @@ Scope {
|
||||
anchors.rightMargin: 8
|
||||
spacing: 10
|
||||
|
||||
// Clock — Digital-7, hh over mm
|
||||
// Clock — readout font, hh over mm
|
||||
Text {
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
text: Qt.formatDateTime(clock.date, "hh\nmm")
|
||||
font.family: "Digital-7 Mono"
|
||||
font.family: Theme.readoutFont
|
||||
font.pointSize: 22
|
||||
font.letterSpacing: 1
|
||||
color: "#EEEEEE"
|
||||
color: Theme.text
|
||||
|
||||
SystemClock {
|
||||
id: clock
|
||||
@@ -266,9 +267,9 @@ Scope {
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
text: Qt.formatDateTime(clock.date, "dd\nMMM").toUpperCase()
|
||||
font.family: "Digital-7 Mono"
|
||||
font.family: Theme.readoutFont
|
||||
font.pointSize: 13
|
||||
color: "#FFD063"
|
||||
color: Theme.accent
|
||||
}
|
||||
|
||||
// Slanted divider
|
||||
@@ -282,7 +283,7 @@ Scope {
|
||||
preferredRendererType: Shape.CurveRenderer
|
||||
ShapePath {
|
||||
strokeWidth: 0
|
||||
fillColor: "#FFD063"
|
||||
fillColor: Theme.accent
|
||||
startX: 8
|
||||
startY: 0
|
||||
PathLine { x: divider.width; y: 0 }
|
||||
@@ -301,9 +302,9 @@ Scope {
|
||||
Text {
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
text: "VOL"
|
||||
font.family: "Digital-7 Mono"
|
||||
font.family: Theme.readoutFont
|
||||
font.pointSize: 10
|
||||
color: "#7A7B7D"
|
||||
color: Theme.muted
|
||||
}
|
||||
|
||||
ColumnLayout {
|
||||
@@ -336,8 +337,8 @@ Scope {
|
||||
|
||||
ShapePath {
|
||||
strokeWidth: 1
|
||||
strokeColor: "#7A7B7D"
|
||||
fillColor: "#292C30"
|
||||
strokeColor: Theme.muted
|
||||
fillColor: Theme.raised
|
||||
|
||||
startX: seg.chamfer
|
||||
startY: 0
|
||||
@@ -375,7 +376,7 @@ Scope {
|
||||
|
||||
ShapePath {
|
||||
strokeWidth: 0
|
||||
fillColor: "#FF6B4A"
|
||||
fillColor: Theme.hot
|
||||
startX: segFill.chamfer
|
||||
startY: 0
|
||||
PathLine { x: segFill.width; y: 0 }
|
||||
@@ -407,8 +408,8 @@ Scope {
|
||||
|
||||
ShapePath {
|
||||
strokeWidth: 1
|
||||
strokeColor: "#7A7B7D"
|
||||
fillColor: "#292C30"
|
||||
strokeColor: Theme.muted
|
||||
fillColor: Theme.raised
|
||||
|
||||
startX: volMeter.chamfer
|
||||
startY: 0
|
||||
@@ -448,7 +449,7 @@ Scope {
|
||||
|
||||
ShapePath {
|
||||
strokeWidth: 0
|
||||
fillColor: root.muted ? "#7A7B7D" : "#FFD063"
|
||||
fillColor: root.muted ? Theme.muted : Theme.accent
|
||||
startX: vol.chamfer
|
||||
startY: 0
|
||||
PathLine { x: vol.width; y: 0 }
|
||||
@@ -466,9 +467,9 @@ Scope {
|
||||
Text {
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
text: root.muted ? "--" : Math.round(root.volume * 100)
|
||||
font.family: "Digital-7 Mono"
|
||||
font.family: Theme.readoutFont
|
||||
font.pointSize: 14
|
||||
color: root.muted ? "#7A7B7D" : "#EEEEEE"
|
||||
color: root.muted ? Theme.muted : Theme.text
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user