shell themes: give the launcher panel its own opacity

tokens.bg_alpha governs the bar, which stays readable at 0.72 because it
covers a thin strip of wallpaper. A full launcher panel at that alpha washes
out badly over a bright wallpaper and its text becomes hard to read — which
is what breadbox looked like, since it hardcoded 0.60 and read no theme value
at all.

Adds [launcher].panel_alpha, set to the approved reference's own values: 0.95
for glass-workbench, 0.93 for liquid-motion.
This commit is contained in:
Breadway 2026-08-26 09:51:51 +08:00
parent 5b5b17fdf4
commit 80e25f23b3
4 changed files with 20 additions and 0 deletions

View file

@ -202,6 +202,7 @@ pub(super) struct RawLauncher {
pub(super) search_font_size: Option<i64>,
pub(super) search_padding_v: Option<i64>,
pub(super) search_padding_h: Option<i64>,
pub(super) panel_alpha: Option<f64>,
pub(super) selection_alpha: Option<f64>,
}
@ -435,6 +436,9 @@ fn resolve_launcher(theme_id: &str, l: Option<&RawLauncher>) -> anyhow::Result<L
search_font_size: l.and_then(|l| l.search_font_size).unwrap_or(16) as i32,
search_padding_v: l.and_then(|l| l.search_padding_v).unwrap_or(12) as i32,
search_padding_h: l.and_then(|l| l.search_padding_h).unwrap_or(16) as i32,
// 0.93 default, not breadbox's historical 0.60: a launcher panel needs
// near-opacity to stay legible over a bright wallpaper.
panel_alpha: l.and_then(|l| l.panel_alpha).unwrap_or(0.93),
selection_alpha: l.and_then(|l| l.selection_alpha).unwrap_or(0.24),
})
}

View file

@ -256,6 +256,14 @@ pub struct Launcher {
pub search_padding_v: i32,
/// Search entry horizontal padding (px).
pub search_padding_h: i32,
/// Opacity of the launcher PANEL itself, distinct from `tokens.bg_alpha`
/// (which governs the thin bar). A bar can be very translucent and stay
/// readable because it is 36-44px tall over a small slice of wallpaper; a
/// full launcher panel at the same alpha washes out badly over a bright
/// wallpaper and its text becomes hard to read. The approved reference
/// uses 0.95 (glass-workbench) and 0.93 (liquid-motion); breadbox
/// previously hardcoded 0.60, which is what made it look washed out.
pub panel_alpha: f64,
/// Selected/hovered row background: `alpha(@accent, selection_alpha)`.
/// Liquid Motion's softer 0.22 vs Glass Workbench's denser 0.28 — see
/// each demo's `.bx .r.sel` rule.