Fix illegible text on light pywal palettes + hot-reload
All checks were successful
Mirror to GitHub / mirror (push) Successful in 3s
All checks were successful
Mirror to GitHub / mirror (push) Successful in 3s
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). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
parent
35e0481314
commit
1671439f90
5 changed files with 27 additions and 39 deletions
|
|
@ -4,7 +4,6 @@ use breadpad_shared::{
|
|||
parser::parse_rule_based,
|
||||
scheduler::Scheduler,
|
||||
store::Store,
|
||||
theme::{build_css, load_palette},
|
||||
types::{Note, NoteType, RecurrenceRule},
|
||||
};
|
||||
use chrono::Local;
|
||||
|
|
@ -924,19 +923,7 @@ fn show_add_note_window(parent: >k4::ApplicationWindow, state: AppState) {
|
|||
// ── CSS ───────────────────────────────────────────────────────────────────────
|
||||
|
||||
fn apply_css(_cfg: &Config) {
|
||||
let palette = load_palette();
|
||||
let user_css = std::fs::read_to_string(breadpad_shared::config::style_css_path()).ok();
|
||||
let css = build_css(&palette, user_css.as_deref());
|
||||
|
||||
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,
|
||||
);
|
||||
// Hot-reloads on `bread-theme reload` (recolours to the new pywal palette
|
||||
// and re-reads the user's style.css). See breadpad_shared::theme::apply_live.
|
||||
breadpad_shared::theme::apply_live();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue