I need to try to understand relm4 more.
This commit is contained in:
parent
5127904fc4
commit
a470c3187c
1 changed files with 13 additions and 4 deletions
|
|
@ -1,6 +1,6 @@
|
||||||
use gtk4::{
|
use gtk4::{
|
||||||
prelude::*, Box as GtkBox, Image, ListBox, Orientation, PositionType, Revealer,
|
prelude::*, Box as GtkBox, Image, ListBox, Orientation, PositionType, RevealerTransitionType,
|
||||||
RevealerTransitionType, Scale, Separator, Window,
|
Scale, Separator, Stack, Window,
|
||||||
};
|
};
|
||||||
use libcosmic_widgets::LabeledItem;
|
use libcosmic_widgets::LabeledItem;
|
||||||
use pulsectl::controllers::types::DeviceInfo;
|
use pulsectl::controllers::types::DeviceInfo;
|
||||||
|
|
@ -15,6 +15,7 @@ pub struct App {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct Widgets {
|
pub struct Widgets {
|
||||||
|
output_stack: Stack,
|
||||||
inputs: ListBox,
|
inputs: ListBox,
|
||||||
outputs: ListBox,
|
outputs: ListBox,
|
||||||
}
|
}
|
||||||
|
|
@ -83,8 +84,16 @@ impl Component for App {
|
||||||
append: _sep = &Separator {
|
append: _sep = &Separator {
|
||||||
set_orientation: Orientation::Horizontal,
|
set_orientation: Orientation::Horizontal,
|
||||||
},
|
},
|
||||||
append: output_revealer = &Revealer {
|
append: output_stack = &Stack {
|
||||||
set_transition_type: RevealerTransitionType::SlideLeft
|
add_child: current_output = &Label {
|
||||||
|
set_text: watch! { model.name.unwrap_or_else(|| "Output Device".into()) }
|
||||||
|
},
|
||||||
|
add_child: list_outputs = &GtkBox {
|
||||||
|
append: outputs = &ListBox {
|
||||||
|
set_selection_mode: gtk4::SelectionMode::None,
|
||||||
|
set_activate_on_single_click: true,
|
||||||
|
},
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue