From c5651b5a9b318d89f2fb2b3e07700f20a6d51a03 Mon Sep 17 00:00:00 2001 From: Breadway Date: Tue, 16 Jun 2026 16:57:12 +0800 Subject: [PATCH] theme: load the shared bread-theme stylesheet 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 --- breadbox/Cargo.toml | 2 +- breadbox/src/main.rs | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/breadbox/Cargo.toml b/breadbox/Cargo.toml index 1de3b4e..f3965f5 100644 --- a/breadbox/Cargo.toml +++ b/breadbox/Cargo.toml @@ -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" diff --git a/breadbox/src/main.rs b/breadbox/src/main.rs index 0fbab50..68627d7 100644 --- a/breadbox/src/main.rs +++ b/breadbox/src/main.rs @@ -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, css: String, history: LaunchHistory) { let query_rc: Rc> = 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(