diff --git a/data/resources/resources.gresource.xml b/data/resources/resources.gresource.xml
index 4419331..8ac59d2 100644
--- a/data/resources/resources.gresource.xml
+++ b/data/resources/resources.gresource.xml
@@ -7,6 +7,8 @@
ui/window.ui
ui/help-overlay.ui
ui/output-dropdown.ui
+ ui/sinkbox.ui
+ ui/outputbox.ui
../icons/com.saivert.pwvucontrol.svg
diff --git a/data/resources/ui/outputbox.ui b/data/resources/ui/outputbox.ui
new file mode 100644
index 0000000..954cadb
--- /dev/null
+++ b/data/resources/ui/outputbox.ui
@@ -0,0 +1,19 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/data/resources/ui/sinkbox.ui b/data/resources/ui/sinkbox.ui
new file mode 100644
index 0000000..8a9f14a
--- /dev/null
+++ b/data/resources/ui/sinkbox.ui
@@ -0,0 +1,21 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/data/resources/ui/volumebox.ui b/data/resources/ui/volumebox.ui
index 1f980ba..e52da45 100644
--- a/data/resources/ui/volumebox.ui
+++ b/data/resources/ui/volumebox.ui
@@ -267,21 +267,5 @@
-
-
-
\ No newline at end of file
diff --git a/src/main.rs b/src/main.rs
index 98c6b0b..bea3aaa 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -34,7 +34,9 @@ mod volumebox;
mod window;
mod manager;
mod withdefaultlistmodel;
-
+mod output_dropdown;
+mod sinkbox;
+mod outputbox;
use std::{ffi::{OsStr, OsString}, path::PathBuf};
@@ -95,7 +97,7 @@ fn main() -> gtk::glib::ExitCode {
Some("resources.gresource"),
))
.or(gio::Resource::load(RESOURCES_FILE))
- .expect(&gettext("Could not load resources"));
+ .unwrap_or_else(|_| { panic!("{}", gettext("Could not load resources")) });
// Load resources
gio::resources_register(&resources);
diff --git a/src/volumebox/output_dropdown.rs b/src/output_dropdown.rs
similarity index 83%
rename from src/volumebox/output_dropdown.rs
rename to src/output_dropdown.rs
index b550bcc..ca2625a 100644
--- a/src/volumebox/output_dropdown.rs
+++ b/src/output_dropdown.rs
@@ -1,19 +1,19 @@
// SPDX-License-Identifier: GPL-3.0-or-later
-use glib::{self, closure_local};
+use crate::{
+ withdefaultlistmodel::WithDefaultListModel,
+ pwnodeobject::PwNodeObject,
+ application::PwvucontrolApplication,
+};
+use glib::closure_local;
use gtk::{self, prelude::*, subclass::prelude::*};
use std::cell::{Cell, RefCell};
-use crate::{withdefaultlistmodel::WithDefaultListModel, pwnodeobject::PwNodeObject, application::PwvucontrolApplication};
use wireplumber as wp;
mod imp {
-
use super::*;
- use glib::Properties;
- use gtk::{self, CompositeTemplate};
-
- #[derive(Debug, Default, CompositeTemplate, Properties)]
+ #[derive(Debug, Default, gtk::CompositeTemplate, glib::Properties)]
#[properties(wrapper_type = super::PwOutputDropDown)]
#[template(resource = "/com/saivert/pwvucontrol/gtk/output-dropdown.ui")]
pub struct PwOutputDropDown {
@@ -65,19 +65,11 @@ mod imp {
let manager = app.manager();
- fn setup_handler(item: &glib::Object, ellipsized: bool) {
+ fn setup_handler(item: &glib::Object) {
let item: >k::ListItem = item.downcast_ref().expect("ListItem");
- let box_ = gtk::Box::new(gtk::Orientation::Horizontal, 0);
let label = gtk::Label::new(None);
- box_.append(&label);
label.set_xalign(0.0);
- if ellipsized {
- label.set_ellipsize(gtk::pango::EllipsizeMode::End);
- } else {
- let icon = gtk::Image::from_icon_name("object-select-symbolic");
- icon.set_accessible_role(gtk::AccessibleRole::Presentation);
- box_.append(&icon);
- }
+ label.set_ellipsize(gtk::pango::EllipsizeMode::End);
item.property_expression("item")
.chain_closure::