Bind help windows to the current monitor's bread-theme palette
Some checks failed
dev release / build (push) Failing after 2m23s

Pin bread-theme to v0.7.4.
This commit is contained in:
Breadway 2026-08-16 13:25:24 +08:00
parent 9c4a1133fb
commit 5ae12e3701
7 changed files with 98 additions and 66 deletions

View file

@ -81,3 +81,8 @@ pub fn load(_display: &gtk4::gdk::Display) {
bread_theme::gtk::apply_shared();
APP_PROVIDER.with(|cell| bread_theme::gtk::apply_css(APP_CSS, cell));
}
pub fn bind_window(window: &impl gtk4::prelude::IsA<gtk4::Native>) {
bread_theme::gtk::bind_window_auto_with_app_css(window, |_| APP_CSS.to_string());
}

View file

@ -49,6 +49,7 @@ pub fn build(
window.set_layer(Layer::Overlay);
window.set_keyboard_mode(KeyboardMode::OnDemand);
window.set_monitor(Some(monitor));
crate::theme::bind_window(&window);
if let Some(rect) = rect {
let (mon_w, mon_h) = monitor_size;

View file

@ -20,6 +20,7 @@ fn new_mask_window(monitor: &gdk4::Monitor) -> Window {
window.set_layer(Layer::Overlay);
window.set_keyboard_mode(KeyboardMode::None);
window.set_monitor(Some(monitor));
crate::theme::bind_window(&window);
let dim = GBox::new(gtk4::Orientation::Vertical, 0);
dim.add_css_class("tour-mask");
dim.set_hexpand(true);

View file

@ -38,6 +38,7 @@ pub fn open(parent: &impl IsA<gtk4::Window>, on_build: impl FnOnce(&Window)) {
.default_height(360)
.build();
window.add_css_class("wizard-dialog");
crate::theme::bind_window(&window);
let header = gtk4::HeaderBar::new();
header.set_show_title_buttons(true);
window.set_titlebar(Some(&header));

View file

@ -131,6 +131,7 @@ fn build(app: &Application) -> Handle {
.build();
crate::theme::load(&WidgetExt::display(&window));
crate::theme::bind_window(&window);
let store = Rc::new(ContentStore::load());
let binds = Rc::new(keybinds::load());