feat(stylesheets): add stylesheet for info bar

This commit is contained in:
doryan 2024-07-19 23:06:34 +04:00
parent f88946b507
commit 7264b704d0
2 changed files with 22 additions and 0 deletions

View File

@ -0,0 +1,3 @@
.info_box{
background-color: yellow;
}

19
src/view/styles/mod.rs Normal file
View File

@ -0,0 +1,19 @@
use adw::gdk::Display;
use gtk4 as gtk;
use std::path::Path;
use gtk::{
style_context_add_provider_for_display, CssProvider, STYLE_PROVIDER_PRIORITY_APPLICATION,
};
pub fn load_css() {
let style_provider = CssProvider::new();
style_provider.load_from_path(Path::new("./src/view/styles/info_bar.css"));
style_context_add_provider_for_display(
&Display::default().expect("Could not connect to a display"),
&style_provider,
STYLE_PROVIDER_PRIORITY_APPLICATION,
);
}