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.
This commit is contained in:
parent
a6007e9a6a
commit
d464689a18
2 changed files with 8 additions and 4 deletions
|
|
@ -9,7 +9,7 @@ name = "breadbox"
|
||||||
path = "src/main.rs"
|
path = "src/main.rs"
|
||||||
|
|
||||||
[dependencies]
|
[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" }
|
breadbox-shared = { path = "../breadbox-shared" }
|
||||||
gtk4 = { version = "0.11", features = ["v4_12"] }
|
gtk4 = { version = "0.11", features = ["v4_12"] }
|
||||||
gtk4-layer-shell = "0.8"
|
gtk4-layer-shell = "0.8"
|
||||||
|
|
|
||||||
|
|
@ -133,9 +133,10 @@ fn matches_term(field: &str, term: &str) -> bool {
|
||||||
|
|
||||||
fn build_css(p: &Palette) -> String {
|
fn build_css(p: &Palette) -> String {
|
||||||
let bg_panel = hex_to_rgba(&p.background, 0.60);
|
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!(
|
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;\
|
.launcher-bg {{ background-color: {bg_panel}; border-radius: 8px;\
|
||||||
box-shadow: 0 8px 32px rgba(0,0,0,0.6); }}\
|
box-shadow: 0 8px 32px rgba(0,0,0,0.6); }}\
|
||||||
searchentry {{ background-color: {surface}; color: {fg}; caret-color: {accent};\
|
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()));
|
let query_rc: Rc<RefCell<String>> = Rc::new(RefCell::new(String::new()));
|
||||||
|
|
||||||
app.connect_activate(move |app| {
|
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();
|
let provider = CssProvider::new();
|
||||||
provider.load_from_string(&css);
|
provider.load_from_string(&css);
|
||||||
gtk4::style_context_add_provider_for_display(
|
gtk4::style_context_add_provider_for_display(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue