theme: load the shared bread-theme stylesheet
All checks were successful
Mirror to GitHub / mirror (push) Successful in 3s

Apply bread_theme::gtk::apply_shared() before breadbox's own CSS so fonts,
palette, and generic widgets come from the shared ecosystem stylesheet. Keep
only launcher-specific rules (launcher-bg, searchentry, rows). Bump bread-theme
dep to v0.2.6.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Breadway 2026-06-16 16:57:12 +08:00
parent 5ccf050f31
commit c5651b5a9b
2 changed files with 8 additions and 4 deletions

View file

@ -9,7 +9,7 @@ name = "breadbox"
path = "src/main.rs"
[dependencies]
bread-theme = { git = "https://github.com/Breadway/bread-ecosystem", tag = "v0.1.0", features = ["gtk"] }
bread-theme = { git = "https://github.com/Breadway/bread-ecosystem", tag = "v0.2.6", features = ["gtk"] }
breadbox-shared = { path = "../breadbox-shared" }
gtk4 = { version = "0.11", features = ["v4_12"] }
gtk4-layer-shell = "0.8"

View file

@ -133,9 +133,10 @@ fn matches_term(field: &str, term: &str) -> bool {
fn build_css(p: &Palette) -> String {
let bg_panel = hex_to_rgba(&p.background, 0.60);
// breadbox-specific rules only — fonts, palette, and generic widgets come
// from the shared ecosystem stylesheet (applied first in connect_activate).
format!(
"* {{ font-family: 'Varela Round', sans-serif; font-size: 14px; }}\
window {{ background-color: transparent; }}\
"window {{ background-color: transparent; }}\
.launcher-bg {{ background-color: {bg_panel}; border-radius: 8px;\
box-shadow: 0 8px 32px rgba(0,0,0,0.6); }}\
searchentry {{ background-color: {surface}; color: {fg}; caret-color: {accent};\
@ -299,7 +300,10 @@ fn run_ui(entries: Vec<DesktopEntry>, css: String, history: LaunchHistory) {
let query_rc: Rc<RefCell<String>> = Rc::new(RefCell::new(String::new()));
app.connect_activate(move |app| {
// Base CSS
// Shared ecosystem base (fonts, palette, generic widgets) first, then
// breadbox-specific CSS layered on top at APPLICATION priority.
bread_theme::gtk::apply_shared();
let provider = CssProvider::new();
provider.load_from_string(&css);
gtk4::style_context_add_provider_for_display(