From 4dfbc1983229cbc79672794985a3412146f9eacd Mon Sep 17 00:00:00 2001 From: Harish Rajagopal Date: Thu, 28 Sep 2023 11:50:15 +0200 Subject: [PATCH] Fix custom CSS not loading with multi-monitor Resolves #38 --- src/gui/component.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/gui/component.rs b/src/gui/component.rs index 692309c..455a70d 100644 --- a/src/gui/component.rs +++ b/src/gui/component.rs @@ -385,7 +385,13 @@ impl AsyncComponent for Greeter { if input.css_path.exists() { debug!("Loading custom CSS from file: {}", input.css_path.display()); - relm4::set_global_css_from_file(input.css_path); + let provider = gtk::CssProvider::new(); + provider.load_from_path(input.css_path); + gtk::StyleContext::add_provider_for_display( + &widgets.ui.display(), + &provider, + gtk::STYLE_PROVIDER_PRIORITY_APPLICATION, + ); }; // Set the default behaviour of pressing the Return key to act like the login button.