Skip to content

Commit

Permalink
Fix custom CSS not loading with multi-monitor
Browse files Browse the repository at this point in the history
Resolves #38
  • Loading branch information
rharish101 committed Sep 28, 2023
1 parent 1962191 commit 4dfbc19
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/gui/component.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 4dfbc19

Please sign in to comment.