Bind breadpad/breadman windows to the current monitor palette
All checks were successful
dev release / build (push) Successful in 9m28s

Pin bread-theme to v0.7.4.
This commit is contained in:
Breadway 2026-08-16 13:23:18 +08:00
parent 852a771651
commit 37713eee9e
6 changed files with 434 additions and 521 deletions

941
Cargo.lock generated

File diff suppressed because it is too large Load diff

View file

@ -16,7 +16,7 @@ bread-screenshots = { git = "https://git.breadway.dev/Breadway/bread-ecosystem",
# Shared `--screenshot` pair validation + settle delay (`screenshot_cli`).
bread-utils = { git = "https://git.breadway.dev/Breadway/bread-ecosystem", tag = "v0.7.2" }
# `adw` implies `gtk`. Local chip/init shims remain in src/theme_widgets.rs.
bread-theme = { git = "https://git.breadway.dev/Breadway/bread-ecosystem", tag = "v0.7.2", features = ["adw"] }
bread-theme = { git = "https://git.breadway.dev/Breadway/bread-ecosystem", tag = "v0.7.4", features = ["adw"] }
libadwaita = { version = "0.9", features = ["v1_7"] }
anyhow.workspace = true
tracing.workspace = true

View file

@ -374,6 +374,7 @@ fn build_app_window(
.default_width(960)
.default_height(640)
.build();
bread_theme::gtk::bind_window_auto(&window);
let hbox = gtk4::Box::builder()
.orientation(gtk4::Orientation::Horizontal)
@ -616,6 +617,7 @@ fn show_add_note_window(parent: &gtk4::ApplicationWindow, state: AppState, prese
.modal(true)
.default_width(500)
.build();
bread_theme::gtk::bind_window_auto(&win);
let vbox = gtk4::Box::builder()
.orientation(gtk4::Orientation::Vertical)

View file

@ -7,7 +7,8 @@ authors.workspace = true
[dependencies]
bread-theme = { git = "https://git.breadway.dev/Breadway/bread-ecosystem", tag = "v0.7.2", features = ["gtk"] }
bread-theme = { git = "https://git.breadway.dev/Breadway/bread-ecosystem", tag = "v0.7.4", features = ["gtk"] }
gtk4.workspace = true
anyhow.workspace = true
tracing.workspace = true
serde.workspace = true

View file

@ -13,6 +13,11 @@ pub fn apply_live() {
});
}
/// Bind a window to the palette of the monitor it is rendered on.
pub fn bind_window(window: &impl gtk4::prelude::IsA<gtk4::Native>) {
bread_theme::gtk::bind_window_auto(window);
}
/// Generate the full breadpad/breadman CSS string. The base — `@define-color`
/// palette, fonts, and generic widget styling — comes from the shared
/// `bread_theme::stylesheet`, so breadpad and breadman look identical to the

View file

@ -451,6 +451,7 @@ fn build_reminder_window(
window.set_layer(Layer::Overlay);
window.set_keyboard_mode(KeyboardMode::Exclusive);
window.auto_exclusive_zone_enable();
breadpad_shared::theme::bind_window(&window);
apply_css(&cfg);
@ -753,6 +754,7 @@ fn build_window(
window.set_anchor(Edge::Bottom, false);
window.set_anchor(Edge::Left, false);
window.set_anchor(Edge::Right, false);
breadpad_shared::theme::bind_window(&window);
apply_css(&cfg);