Simplify CSS resource loading
This commit is contained in:
parent
5eb18e231f
commit
ec0b5ce757
1 changed files with 1 additions and 3 deletions
|
|
@ -8,7 +8,6 @@ use std::cmp::max;
|
|||
use std::thread;
|
||||
|
||||
use gtk4::gdk::Display;
|
||||
use gtk4::gio::File;
|
||||
use gtk4::{CssProvider, Settings, gio};
|
||||
use relm4::RelmApp;
|
||||
|
||||
|
|
@ -40,12 +39,11 @@ fn include_app_css() {
|
|||
|
||||
gio::resources_register_include!("zoodex.gresource")
|
||||
.expect("CSS resource bundle should have valid format");
|
||||
let app_css = File::for_uri("resource:///com/kernelmaft/zoodex/application.css");
|
||||
|
||||
let provider = CssProvider::new();
|
||||
let display = Display::default().expect("getting the default GDK4 display should never fail");
|
||||
|
||||
provider.load_from_file(&app_css);
|
||||
provider.load_from_resource("/com/kernelmaft/zoodex/application.css");
|
||||
gtk4::style_context_add_provider_for_display(
|
||||
&display,
|
||||
&provider,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue