TASK 58: the properties panel wears the theme (no more light-system chrome)
The creator asked why the Stream Alerts "Display" drop-down was not in the same
style as the other drop-downs. It was never given the theme's YtComboBox style -
only a hand-painted Background/Foreground. Setting colours changes the paint, not
the template, so WPF still drew the light system ComboBox (grey border, system
arrow, white popup list) on top of the dark panel. The chat Font drop-down was a
copy of the same mistake, and every check box was the light system one.
The sweep of the whole properties panel (then the app):
- ComboBox x2 (chat Font, alert Display) -> YtComboBox, hand-painted colours gone
- TextBox x16 in the properties panel -> YtTextBoxCompact (new, BasedOn YtTextBox:
11px / padding 4,2 - the panel is dense, the full 13px box would double it)
- CheckBox x2 (chat) + x3 (preview broadcast) + x1 (socials dialog) -> YtCheckBox
(new: a 14x14 rounded box + tick path, accent fill when checked)
- the layer-rename field -> YtTextBoxCompact via BasedOn, still borderless
- buttons, pills, sliders: already themed, untouched
The sweep also killed a typo'd foreground (#e0d0e0 for #e0e0e0) and the only
remaining hand-painted colour is the deliberate dimming of the two read-only path
fields.
Guard: ytLive.Tests/PropertiesStyleTests.cs (the ONE Good Dog test) parses the app
XAML and fails if an unstyled drop-down, check box or properties field comes back.
431/431 green, 0 warnings.
This commit is contained in:
@@ -2078,3 +2078,25 @@ that does not contain a dash (e.g. the `if (...) return false;` line instead of
|
||||
it), and put the new prose in the `newString` where any character is fine. When a whole stale block
|
||||
must go (e.g. half-overwritten comments), a three-line `python3` script that deletes the exact line
|
||||
range is faster and safer than fighting the matcher.
|
||||
|
||||
## 2026-10-21 — A WPF CONTROL WITH NO STYLE DRAWS THE LIGHT SYSTEM CHROME (RECIPE — TASK 58)
|
||||
|
||||
The creator asked why the Stream Alerts "Display" drop-down looked like it belonged to another
|
||||
app. The cause is not a colour: **setting `Background`/`Foreground`/`FontSize` on a WPF control
|
||||
changes its paint, not its TEMPLATE.** An unstyled `ComboBox` still renders the system template —
|
||||
grey border, system arrow, **white popup list** — so a dark blue box sat on the dark panel
|
||||
wearing light-system chrome. Unstyled `CheckBox` is the same story.
|
||||
|
||||
**The recipe (audit + fix + guard):**
|
||||
1. **Audit by grep, not by eye:** `grep -rn "<ComboBox\|<CheckBox" --include="*.xaml"` and look at
|
||||
each one's `Style` attribute. Hand-painted colours are the smell — they mean "no style".
|
||||
2. **Fix by style, never by more painting:** put the look in `Themes/Controls.xaml` once
|
||||
(`YtComboBox`, `YtCheckBox`, a `BasedOn` compact variant when the panel is dense) and delete
|
||||
the per-control colours. A dense panel needs a *variant* of the style, not a re-painted control.
|
||||
3. **Guard it with a test** that parses the XAML and fails when a control of that type has no
|
||||
style — otherwise the next hand-painted control walks the look back.
|
||||
4. **Check the inherited defaults while you are there:** a compact `BasedOn` variant must set the
|
||||
metrics it overrides (`FontSize`, `Padding`, `MinHeight`) or the panel silently changes density.
|
||||
|
||||
**Side effect worth naming:** the sweep also exposed a typo'd foreground (`#e0d0e0` instead of
|
||||
`#e0e0e0`) that only a single source of truth can prevent from recurring.
|
||||
|
||||
Reference in New Issue
Block a user