From d464689a184a9fb846aa77b27ab727a742113bf0 Mon Sep 17 00:00:00 2001 From: Breadway Date: Tue, 16 Jun 2026 16:57:12 +0800 Subject: [PATCH 1/6] 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. --- 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( From 732c3126ae50941d7b4ccc1442a8d8d4fe0930cb Mon Sep 17 00:00:00 2001 From: Breadway Date: Tue, 16 Jun 2026 18:32:12 +0800 Subject: [PATCH 2/6] Release 0.2.2: shared bread-theme stylesheet Pin bread-theme v0.2.6 and load the shared ecosystem stylesheet. --- Cargo.lock | 10 +++++----- breadbox-shared/Cargo.toml | 2 +- breadbox-sync/Cargo.toml | 2 +- breadbox/Cargo.toml | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 77c0113..88fcfd0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -28,8 +28,8 @@ checksum = "b4388bee8683e3d04af747c73422af53102d2bd24d9eadb6cbc100baef4b43f8" [[package]] name = "bread-theme" -version = "0.1.0" -source = "git+https://github.com/Breadway/bread-ecosystem?tag=v0.1.0#6b5f4f475f66a645b08cb865e6dda8228d23679b" +version = "0.2.3" +source = "git+https://github.com/Breadway/bread-ecosystem?tag=v0.2.6#0c8c5c00e435fedff4f81e36d603424c153519a9" dependencies = [ "dirs", "gtk4", @@ -39,7 +39,7 @@ dependencies = [ [[package]] name = "breadbox" -version = "0.2.1" +version = "0.2.2" dependencies = [ "bread-theme", "breadbox-shared", @@ -50,7 +50,7 @@ dependencies = [ [[package]] name = "breadbox-shared" -version = "0.2.1" +version = "0.2.2" dependencies = [ "serde", "serde_json", @@ -59,7 +59,7 @@ dependencies = [ [[package]] name = "breadbox-sync" -version = "0.2.1" +version = "0.2.2" dependencies = [ "breadbox-shared", "serde_json", diff --git a/breadbox-shared/Cargo.toml b/breadbox-shared/Cargo.toml index a47dc19..9a3de5c 100644 --- a/breadbox-shared/Cargo.toml +++ b/breadbox-shared/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "breadbox-shared" -version = "0.2.1" +version = "0.2.2" edition = "2021" license = "MIT" diff --git a/breadbox-sync/Cargo.toml b/breadbox-sync/Cargo.toml index 93b7392..d60c2fa 100644 --- a/breadbox-sync/Cargo.toml +++ b/breadbox-sync/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "breadbox-sync" -version = "0.2.1" +version = "0.2.2" edition = "2021" license = "MIT" diff --git a/breadbox/Cargo.toml b/breadbox/Cargo.toml index f3965f5..f5784c8 100644 --- a/breadbox/Cargo.toml +++ b/breadbox/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "breadbox" -version = "0.2.1" +version = "0.2.2" edition = "2021" license = "MIT" From 8c64ec1bf2b6b60fc953fb4169e7a5de9afa0a33 Mon Sep 17 00:00:00 2001 From: Breadway Date: Tue, 16 Jun 2026 18:32:48 +0800 Subject: [PATCH 3/6] Release 0.2.4: shared bread-theme stylesheet --- Cargo.lock | 6 +++--- breadbox-shared/Cargo.toml | 2 +- breadbox-sync/Cargo.toml | 2 +- breadbox/Cargo.toml | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 88fcfd0..18d6e7c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -39,7 +39,7 @@ dependencies = [ [[package]] name = "breadbox" -version = "0.2.2" +version = "0.2.4" dependencies = [ "bread-theme", "breadbox-shared", @@ -50,7 +50,7 @@ dependencies = [ [[package]] name = "breadbox-shared" -version = "0.2.2" +version = "0.2.4" dependencies = [ "serde", "serde_json", @@ -59,7 +59,7 @@ dependencies = [ [[package]] name = "breadbox-sync" -version = "0.2.2" +version = "0.2.4" dependencies = [ "breadbox-shared", "serde_json", diff --git a/breadbox-shared/Cargo.toml b/breadbox-shared/Cargo.toml index 9a3de5c..ec62ed1 100644 --- a/breadbox-shared/Cargo.toml +++ b/breadbox-shared/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "breadbox-shared" -version = "0.2.2" +version = "0.2.4" edition = "2021" license = "MIT" diff --git a/breadbox-sync/Cargo.toml b/breadbox-sync/Cargo.toml index d60c2fa..bdcab16 100644 --- a/breadbox-sync/Cargo.toml +++ b/breadbox-sync/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "breadbox-sync" -version = "0.2.2" +version = "0.2.4" edition = "2021" license = "MIT" diff --git a/breadbox/Cargo.toml b/breadbox/Cargo.toml index f5784c8..6f23930 100644 --- a/breadbox/Cargo.toml +++ b/breadbox/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "breadbox" -version = "0.2.2" +version = "0.2.4" edition = "2021" license = "MIT" From 83b9fd908ea6bab8d089b2fee24b8bd149e8e48b Mon Sep 17 00:00:00 2001 From: Breadway Date: Wed, 17 Jun 2026 12:41:30 +0800 Subject: [PATCH 4/6] Fix illegible text on light pywal palettes + hot-reload Use bread-theme 0.2.7's luminance-picked ink (@on-*): a selected/hovered row set its background to `surface` but kept the pywal foreground, so the highlighted item went unreadable when `surface` came out light. Colour is now set per surface (panel, search box, row states) and labels inherit it. Switch to bread_theme::gtk::apply_app_css so breadbox picks up `bread-theme reload` (and rebuilds from the fresh palette on each launch). --- Cargo.lock | 2 +- breadbox/Cargo.toml | 2 +- breadbox/src/main.rs | 47 ++++++++++++++++++++------------------------ 3 files changed, 23 insertions(+), 28 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 18d6e7c..ca7661c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -29,7 +29,7 @@ checksum = "b4388bee8683e3d04af747c73422af53102d2bd24d9eadb6cbc100baef4b43f8" [[package]] name = "bread-theme" version = "0.2.3" -source = "git+https://github.com/Breadway/bread-ecosystem?tag=v0.2.6#0c8c5c00e435fedff4f81e36d603424c153519a9" +source = "git+https://github.com/Breadway/bread-ecosystem?tag=v0.2.7#ea87083c0615fc9141b0ae4c99f833748a0189d1" dependencies = [ "dirs", "gtk4", diff --git a/breadbox/Cargo.toml b/breadbox/Cargo.toml index 6f23930..6b71c50 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.2.6", features = ["gtk"] } +bread-theme = { git = "https://github.com/Breadway/bread-ecosystem", tag = "v0.2.7", 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 68627d7..17f72ac 100644 --- a/breadbox/src/main.rs +++ b/breadbox/src/main.rs @@ -1,4 +1,4 @@ -use bread_theme::{hex_to_rgba, load_palette, Palette}; +use bread_theme::{hex_to_rgba, ink_on, load_palette, Palette}; use std::{ cell::RefCell, collections::HashMap, @@ -15,7 +15,6 @@ use breadbox_shared::{ config_dir, load_all_desktop_entries, Config, DesktopEntry, IconCache, LaunchHistory, }; use gtk4::{ - gdk::Display, glib, pango::EllipsizeMode, prelude::*, @@ -135,25 +134,30 @@ 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). + // Colour is set on each surface (panel, search box, hovered/selected row) so + // child labels inherit the legible ink for that background. `on_*` are + // luminance-picked black/white — the pywal hues are untouched. Without this a + // light `surface` slot makes the selected row's text vanish. format!( "window {{ background-color: transparent; }}\ - .launcher-bg {{ background-color: {bg_panel}; border-radius: 8px;\ + .launcher-bg {{ background-color: {bg_panel}; color: {on_bg}; border-radius: 8px;\ 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: {on_surface}; caret-color: {accent};\ border: none; outline: none; box-shadow: none;\ padding: 12px 16px; border-radius: 6px 6px 0 0; }}\ listbox {{ background-color: transparent; padding: 4px; }}\ - row {{ padding: 8px 12px; color: {fg}; background-color: transparent;\ + row {{ padding: 8px 12px; color: {on_bg}; background-color: transparent;\ border-radius: 6px; }}\ - row:hover {{ background-color: {surface}; }}\ - row:selected {{ background-color: {surface}; }}\ + row:hover {{ background-color: {surface}; color: {on_surface}; }}\ + row:selected {{ background-color: {surface}; color: {on_surface}; }}\ .app-name {{ font-size: 14px; }}\ - .app-muted {{ color: {fg}; opacity: 0.6; font-size: 12px; }}\ + .app-muted {{ opacity: 0.6; font-size: 12px; }}\ image {{ margin-right: 8px; }}", - bg_panel = bg_panel, - surface = p.color0, - fg = p.foreground, - accent = p.color4, + bg_panel = bg_panel, + surface = p.color0, + accent = p.color4, + on_bg = ink_on(&p.background), + on_surface = ink_on(&p.color0), ) } @@ -291,7 +295,7 @@ fn get_row_entry(row: >k4::ListBoxRow) -> Option { } } -fn run_ui(entries: Vec, css: String, history: LaunchHistory) { +fn run_ui(entries: Vec, history: LaunchHistory) { let app = Application::builder() .application_id("com.breadway.breadbox") .build(); @@ -301,16 +305,10 @@ fn run_ui(entries: Vec, css: String, history: LaunchHistory) { app.connect_activate(move |app| { // Shared ecosystem base (fonts, palette, generic widgets) first, then - // breadbox-specific CSS layered on top at APPLICATION priority. + // breadbox-specific CSS layered on top — both hot-reload on + // `bread-theme reload` (the closure re-reads the pywal palette). bread_theme::gtk::apply_shared(); - - let provider = CssProvider::new(); - provider.load_from_string(&css); - gtk4::style_context_add_provider_for_display( - &Display::default().expect("no display"), - &provider, - gtk4::STYLE_PROVIDER_PRIORITY_APPLICATION, - ); + bread_theme::gtk::apply_app_css(|| build_css(&load_palette())); // User CSS override { @@ -566,8 +564,5 @@ fn main() { let manifest = load_manifest(); let entries = load_sorted_entries(&manifest, &priority, &history); - let palette = load_palette(); - let css = build_css(&palette); - - run_ui(entries, css, history); + run_ui(entries, history); } From a33e979e5ee53cb051b80f7e03e95a19400be750 Mon Sep 17 00:00:00 2001 From: Breadway Date: Wed, 17 Jun 2026 12:55:52 +0800 Subject: [PATCH 5/6] Bump bread-theme to v0.2.8 (live-reload fix) --- Cargo.lock | 2 +- breadbox/Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ca7661c..4f3f9c2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -29,7 +29,7 @@ checksum = "b4388bee8683e3d04af747c73422af53102d2bd24d9eadb6cbc100baef4b43f8" [[package]] name = "bread-theme" version = "0.2.3" -source = "git+https://github.com/Breadway/bread-ecosystem?tag=v0.2.7#ea87083c0615fc9141b0ae4c99f833748a0189d1" +source = "git+https://github.com/Breadway/bread-ecosystem?tag=v0.2.8#77417d552130281ff787e07d52541eb25e9d533b" dependencies = [ "dirs", "gtk4", diff --git a/breadbox/Cargo.toml b/breadbox/Cargo.toml index 6b71c50..9189abf 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.2.7", features = ["gtk"] } +bread-theme = { git = "https://github.com/Breadway/bread-ecosystem", tag = "v0.2.8", features = ["gtk"] } breadbox-shared = { path = "../breadbox-shared" } gtk4 = { version = "0.11", features = ["v4_12"] } gtk4-layer-shell = "0.8" From 7ece4fd7626d7c7b880ea2172dd7a3bea27a6c73 Mon Sep 17 00:00:00 2001 From: Breadway Date: Fri, 19 Jun 2026 08:38:38 +0800 Subject: [PATCH 6/6] CI: use /tmp for ecosystem clone, avoid permissions conflict --- .github/workflows/release.yml | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 71c0ca3..12f8fac 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -9,7 +9,7 @@ permissions: env: DL_DIR: /srv/breadway-dl - ECOSYSTEM_DIR: /home/breadway/Projects/bread-ecosystem + ECOSYSTEM_DIR: /tmp/bread-ecosystem-ci jobs: build: @@ -41,12 +41,8 @@ jobs: - name: ensure bread-ecosystem run: | - if [[ -d "${ECOSYSTEM_DIR}/.git" ]]; then - git -C "${ECOSYSTEM_DIR}" pull --ff-only - else - mkdir -p "$(dirname "${ECOSYSTEM_DIR}")" - git clone https://github.com/Breadway/bread-ecosystem.git "${ECOSYSTEM_DIR}" - fi + rm -rf "${ECOSYSTEM_DIR}" + git clone https://github.com/Breadway/bread-ecosystem.git "${ECOSYSTEM_DIR}" - name: regenerate index.json run: bash "${ECOSYSTEM_DIR}/scripts/gen-index.sh"