Skip to content

Commit

Permalink
Load from resource instead
Browse files Browse the repository at this point in the history
  • Loading branch information
saivert committed Dec 26, 2023
1 parent f8e2379 commit b297fe9
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 17 deletions.
1 change: 1 addition & 0 deletions data/resources/resources.gresource.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
<file preprocess="xml-stripblanks" alias="gtk/profile-dropdown.ui">ui/profile-dropdown.ui</file>
<file preprocess="xml-stripblanks" alias="gtk/devicebox.ui">ui/devicebox.ui</file>
<file preprocess="xml-stripblanks" alias="gtk/profilerow.ui">ui/profilerow.ui</file>
<file>ui/levelbar.css</file>
</gresource>
<gresource prefix="/com/saivert/pwvucontrol/icons/scalable/actions">
<file preprocess="xml-stripblanks" alias="com.saivert.pwvucontrol.svg">../icons/com.saivert.pwvucontrol.svg</file>
Expand Down
13 changes: 13 additions & 0 deletions data/resources/ui/levelbar.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
levelbar block.filled {
filter: blur(2px);
}
levelbar trough {
background-color: rgba(0,0,0,0);
border: none;
}
levelbar block.empty {
background-color: rgba(0,0,0,0);
}
levelbar block {
border: none;
}
18 changes: 1 addition & 17 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,23 +80,7 @@ fn main() -> gtk::glib::ExitCode {
gio::resources_register(&resources);

let css = gtk::CssProvider::new();
css.load_from_data(
r#"
levelbar block.filled {
filter: blur(2px);
}
levelbar trough {
background-color: rgba(0,0,0,0);
border: none;
}
levelbar block.empty {
background-color: rgba(0,0,0,0);
}
levelbar block {
border: none;
}
"#,
);
css.load_from_resource("/com/saivert/pwvucontrol/ui/levelbar.css");

gtk::style_context_add_provider_for_display(
&gtk::gdk::Display::default().unwrap(),
Expand Down

0 comments on commit b297fe9

Please sign in to comment.