Theming — BCC is dark-only; add a light theme and system-following #75
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Correction to the original filing
I first wrote this up as "BCC renders as a bright white window on a dark desktop." That's backwards, and I should have read the constants before filing. BCC is already dark —
BG = "#1b1d23",PANEL = "#23262e",TEXT = "#e7e9ee", applied through a single module-levelSTYLESHEETinbcc.py.The actual gap: the theme is hardcoded dark with no light option and no awareness of the OS appearance. A user on a light desktop gets a dark window that matches nothing else on their screen, with no way to change it.
What exists
ACCENT,BG,PANEL,PANEL_2,TEXT,MUTED,BORDER,GOOD,BAD,WARN).STYLESHEETbuilt from them, applied globally.setStyleSheet(f"color: {MUTED}")-style calls scattered throughbcc.py, plusSTATUS_COLORS/HEALTH_COLORSlookup tables.So the colour vocabulary is already factored — it's just bound to one palette at import time.
Scope
Palettevalue type plusDARK(byte-identical to today's colours — this must not be a redesign) and a newLIGHT.QSettingsnext to the existing splitter geometry andupdate/autoCheck.resolve_theme(setting, system_is_dark) -> "light" | "dark"inbcc_coreso the decision logic is testable without a Qt app.STYLESHEETbecomesbuild_stylesheet(palette).The hard part
The ~20 inline
setStyleSheetcalls read module-level constants at call time. Switching theme live means those either re-run or go stale, showing dark-theme colours on a light window. Options: re-apply global QSS and refresh the affected panes on switch, or accept a "restart to apply" for inline-styled bits. Prefer live if it's clean; don't ship a half-updated window.Constraints
-apple-systemor any web font stack in the QSS. Removed deliberately; the comment aboveSTYLESHEETexplains why (forces a costly font-alias scan). Native system fonts only.GOOD(#4ade80) andWARN(#fbbf24) were picked against a dark background and will not carry to white — the health column and status dots need light-palette variants that actually meet contrast.#1a1205as on-accent text,#202229for the disabled table,#16181dfor the diagnostics pane). These need palette slots, not literals.Tests
resolve_themeacross all three settings × both OS appearances; palette completeness (every slot the stylesheet references exists in both palettes, so a missing key fails a test rather than rendering a broken window).Dark mode / theming — light/dark toggle with persistenceto Theming — BCC is dark-only; add a light theme and system-following