Minor UI improvements at the instances page

This commit is contained in:
Bnyro 2023-07-16 20:06:13 +02:00
parent 3ce4fc0c3f
commit 700630da2f
1 changed files with 11 additions and 6 deletions

View File

@ -8,7 +8,7 @@ use super::instance_row::InstanceRow;
pub struct InstancesPage { pub struct InstancesPage {
instances: FactoryVecDeque<InstanceRow>, instances: FactoryVecDeque<InstanceRow>,
instances_search_buffer: gtk::EntryBuffer instances_search_buffer: gtk::EntryBuffer,
} }
#[derive(Debug)] #[derive(Debug)]
@ -43,10 +43,10 @@ impl SimpleComponent for InstancesPage {
add_child = &gtk::ScrolledWindow { add_child = &gtk::ScrolledWindow {
set_vexpand: true, set_vexpand: true,
set_hexpand: true, set_hexpand: true,
gtk::Box { gtk::Box {
set_orientation: gtk::Orientation::Vertical, set_orientation: gtk::Orientation::Vertical,
set_spacing: 10, set_spacing: 10,
set_margin_all: 10,
gtk::Box { gtk::Box {
set_spacing: 10, set_spacing: 10,
@ -60,10 +60,12 @@ impl SimpleComponent for InstancesPage {
connect_clicked => InstancesPageInput::FetchInstances, connect_clicked => InstancesPageInput::FetchInstances,
} }
}, },
#[local_ref] #[local_ref]
instances -> gtk::Box { instances -> gtk::Box {
set_orientation: gtk::Orientation::Vertical, set_orientation: gtk::Orientation::Vertical,
set_spacing: 5, set_spacing: 5,
set_margin_all: 10,
set_vexpand: true, set_vexpand: true,
}, },
} }
@ -104,7 +106,10 @@ impl SimpleComponent for InstancesPage {
) -> ComponentParts<Self> { ) -> ComponentParts<Self> {
let instances = FactoryVecDeque::new(gtk::Box::default(), sender.input_sender()); let instances = FactoryVecDeque::new(gtk::Box::default(), sender.input_sender());
let instances_search_buffer = gtk::EntryBuffer::builder().build(); let instances_search_buffer = gtk::EntryBuffer::builder().build();
let model = Self { instances, instances_search_buffer }; let model = Self {
instances,
instances_search_buffer,
};
let instances = model.instances.widget(); let instances = model.instances.widget();
let widgets = view_output!(); let widgets = view_output!();
ComponentParts { model, widgets } ComponentParts { model, widgets }