Compare commits

..

3 commits
v0.3.4 ... main

Author SHA1 Message Date
Breadway
df42aba1d3 CI: use /tmp for ecosystem clone, avoid permissions conflict
All checks were successful
Mirror to GitHub / mirror (push) Successful in 2s
2026-06-19 08:38:40 +08:00
Breadway
e0b55e1713 Bump bread-theme to v0.2.8 (live-reload fix)
Some checks failed
Mirror to GitHub / mirror (push) Successful in 2s
Build and publish package / package (push) Failing after 4m47s
2026-06-17 12:55:57 +08:00
Breadway
c30aa2497e Fix illegible text on light pywal palettes + hot-reload
Use bread-theme 0.2.7's luminance-picked ink (@on-*): type chips on @overlay and
selected sidebar rows / confirm buttons on @blue kept @fg or @bg, which vanished
when those slots came out light/dark. They now use @on-overlay / @on-accent.

Add breadpad_shared::theme::apply_live (wraps bread_theme::gtk::apply_app_css) so
breadpad and breadman recolour live on `bread-theme reload` and re-read the user's
style.css — replacing the build-once provider. bread-theme bumped to v0.2.7
(gtk feature).
2026-06-17 12:42:12 +08:00
6 changed files with 30 additions and 46 deletions

View file

@ -9,7 +9,7 @@ permissions:
env: env:
DL_DIR: /srv/breadway-dl DL_DIR: /srv/breadway-dl
ECOSYSTEM_DIR: /home/breadway/Projects/bread-ecosystem ECOSYSTEM_DIR: /tmp/bread-ecosystem-ci
jobs: jobs:
build: build:
@ -40,12 +40,8 @@ jobs:
- name: ensure bread-ecosystem - name: ensure bread-ecosystem
run: | run: |
if [[ -d "${ECOSYSTEM_DIR}/.git" ]]; then rm -rf "${ECOSYSTEM_DIR}"
git -C "${ECOSYSTEM_DIR}" pull --ff-only git clone https://github.com/Breadway/bread-ecosystem.git "${ECOSYSTEM_DIR}"
else
mkdir -p "$(dirname "${ECOSYSTEM_DIR}")"
git clone https://github.com/Breadway/bread-ecosystem.git "${ECOSYSTEM_DIR}"
fi
- name: regenerate index.json - name: regenerate index.json
run: bash "${ECOSYSTEM_DIR}/scripts/gen-index.sh" run: bash "${ECOSYSTEM_DIR}/scripts/gen-index.sh"

3
Cargo.lock generated
View file

@ -305,9 +305,10 @@ dependencies = [
[[package]] [[package]]
name = "bread-theme" name = "bread-theme"
version = "0.2.3" 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.8#77417d552130281ff787e07d52541eb25e9d533b"
dependencies = [ dependencies = [
"dirs 5.0.1", "dirs 5.0.1",
"gtk4",
"serde", "serde",
"serde_json", "serde_json",
] ]

View file

@ -4,7 +4,6 @@ use breadpad_shared::{
parser::parse_rule_based, parser::parse_rule_based,
scheduler::Scheduler, scheduler::Scheduler,
store::Store, store::Store,
theme::{build_css, load_palette},
types::{Note, NoteType, RecurrenceRule}, types::{Note, NoteType, RecurrenceRule},
}; };
use chrono::Local; use chrono::Local;
@ -924,19 +923,7 @@ fn show_add_note_window(parent: &gtk4::ApplicationWindow, state: AppState) {
// ── CSS ─────────────────────────────────────────────────────────────────────── // ── CSS ───────────────────────────────────────────────────────────────────────
fn apply_css(_cfg: &Config) { fn apply_css(_cfg: &Config) {
let palette = load_palette(); // Hot-reloads on `bread-theme reload` (recolours to the new pywal palette
let user_css = std::fs::read_to_string(breadpad_shared::config::style_css_path()).ok(); // and re-reads the user's style.css). See breadpad_shared::theme::apply_live.
let css = build_css(&palette, user_css.as_deref()); breadpad_shared::theme::apply_live();
let provider = gtk4::CssProvider::new();
provider.load_from_string(&css);
let Some(display) = gtk4::gdk::Display::default() else {
tracing::warn!("no default display; skipping CSS provider");
return;
};
gtk4::style_context_add_provider_for_display(
&display,
&provider,
gtk4::STYLE_PROVIDER_PRIORITY_APPLICATION,
);
} }

View file

@ -7,7 +7,7 @@ authors.workspace = true
[dependencies] [dependencies]
bread-theme = { git = "https://github.com/Breadway/bread-ecosystem", tag = "v0.2.6" } bread-theme = { git = "https://github.com/Breadway/bread-ecosystem", tag = "v0.2.8", features = ["gtk"] }
anyhow.workspace = true anyhow.workspace = true
tracing.workspace = true tracing.workspace = true
serde.workspace = true serde.workspace = true

View file

@ -1,5 +1,18 @@
pub use bread_theme::{load_palette, Palette}; pub use bread_theme::{load_palette, Palette};
/// Apply breadpad/breadman's stylesheet and keep it live across palette changes.
/// [`build_css`] bundles the shared component sheet with the app's own rules from
/// the current pywal palette; `bread_theme::gtk::apply_app_css` re-runs this
/// whenever `bread-theme reload` rewrites the shared theme file, so the UI
/// recolours in place (and re-reads the user's `style.css` override too).
pub fn apply_live() {
bread_theme::gtk::apply_app_css(|| {
let palette = load_palette();
let user_css = std::fs::read_to_string(crate::config::style_css_path()).ok();
build_css(&palette, user_css.as_deref())
});
}
/// Generate the full breadpad/breadman CSS string. The base — `@define-color` /// Generate the full breadpad/breadman CSS string. The base — `@define-color`
/// palette, fonts, and generic widget styling — comes from the shared /// palette, fonts, and generic widget styling — comes from the shared
/// `bread_theme::stylesheet`, so breadpad and breadman look identical to the /// `bread_theme::stylesheet`, so breadpad and breadman look identical to the
@ -32,7 +45,7 @@ window { border-radius: 8px; }
.type-chip { .type-chip {
background: @overlay; background: @overlay;
color: @fg; color: @on-overlay;
border-radius: 999px; border-radius: 999px;
padding: 4px 12px; padding: 4px 12px;
font-size: 12px; font-size: 12px;
@ -41,12 +54,12 @@ window { border-radius: 8px; }
.type-chip.active { .type-chip.active {
background: @blue; background: @blue;
color: @bg; color: @on-accent;
} }
.confirm-button { .confirm-button {
background: @blue; background: @blue;
color: @bg; color: @on-accent;
border: none; border: none;
border-radius: 8px; border-radius: 8px;
padding: 8px 16px; padding: 8px 16px;
@ -90,7 +103,7 @@ window { border-radius: 8px; }
.sidebar-row:selected { .sidebar-row:selected {
background: @blue; background: @blue;
color: @bg; color: @on-accent;
font-weight: 500; font-weight: 500;
} }

View file

@ -2,10 +2,9 @@ use anyhow::Result;
use breadpad_shared::{ use breadpad_shared::{
calendar::CalDavClient, calendar::CalDavClient,
classifier::Classifier, classifier::Classifier,
config::{style_css_path, Config}, config::Config,
scheduler::Scheduler, scheduler::Scheduler,
store::Store, store::Store,
theme::{build_css, load_palette},
types::{Note, NoteType}, types::{Note, NoteType},
}; };
use gtk4::{glib, prelude::*}; use gtk4::{glib, prelude::*};
@ -765,19 +764,7 @@ fn save_note_classified(
} }
fn apply_css(_cfg: &Config) { fn apply_css(_cfg: &Config) {
let palette = load_palette(); // Hot-reloads on `bread-theme reload` (recolours to the new pywal palette
let user_css = std::fs::read_to_string(style_css_path()).ok(); // and re-reads the user's style.css). See breadpad_shared::theme::apply_live.
let css = build_css(&palette, user_css.as_deref()); breadpad_shared::theme::apply_live();
let provider = gtk4::CssProvider::new();
provider.load_from_string(&css);
let Some(display) = gtk4::gdk::Display::default() else {
tracing::warn!("no default display; skipping CSS provider");
return;
};
gtk4::style_context_add_provider_for_display(
&display,
&provider,
gtk4::STYLE_PROVIDER_PRIORITY_APPLICATION,
);
} }