Finalize UI of manual ROW

This commit is contained in:
Ward from fusion-voyager-3 2024-08-18 22:06:06 +03:00
parent 991b42ab49
commit 8631312248
2 changed files with 46 additions and 12 deletions

View File

@ -76,8 +76,8 @@
"efi_error_text_label": "PikaOS Only works on GPT UEFI Systems, this machine is booted in CSM/LEGACY mode.", "efi_error_text_label": "PikaOS Only works on GPT UEFI Systems, this machine is booted in CSM/LEGACY mode.",
"exit_button_label": "exit_button_label", "exit_button_label": "exit_button_label",
"subtitle_partition": "Partition", "subtitle_partition": "Partition",
"title_mountpoint": "Mountpoint", "title_mountpoint": "Mountpoint\nE.g: /var",
"title_mountopts": "Additional Mount Options", "title_mountopts": "Additional Mount Options\nE.g: subvol=@home",
"pika_install_good": "The installation of PikaOS has been completed sucessfully.", "pika_install_good": "The installation of PikaOS has been completed sucessfully.",
"reboot": "Reboot", "reboot": "Reboot",
"pika_install_bad": "PikaOS has Failed!\nCheck logs for further info.", "pika_install_bad": "PikaOS has Failed!\nCheck logs for further info.",

View File

@ -58,6 +58,7 @@ impl ObjectImpl for DriveMountRow {
let partition_row_expander_adw_listbox = gtk::ListBox::builder() let partition_row_expander_adw_listbox = gtk::ListBox::builder()
.hexpand(true) .hexpand(true)
.vexpand(true) .vexpand(true)
.selection_mode(gtk::SelectionMode::None)
.margin_bottom(5) .margin_bottom(5)
.margin_top(5) .margin_top(5)
.margin_start(5) .margin_start(5)
@ -65,12 +66,36 @@ impl ObjectImpl for DriveMountRow {
.build(); .build();
partition_row_expander_adw_listbox.add_css_class("boxed-list"); partition_row_expander_adw_listbox.add_css_class("boxed-list");
let mountpoint_entry_row_adw_listbox = gtk::ListBox::builder()
.hexpand(true)
.vexpand(true)
.valign(gtk::Align::Start)
.selection_mode(gtk::SelectionMode::None)
.margin_bottom(5)
.margin_top(5)
.margin_start(5)
.margin_end(5)
.build();
mountpoint_entry_row_adw_listbox.add_css_class("boxed-list");
let mountopts_entry_row_adw_listbox = gtk::ListBox::builder()
.hexpand(true)
.vexpand(true)
.valign(gtk::Align::Start)
.selection_mode(gtk::SelectionMode::None)
.margin_bottom(5)
.margin_top(5)
.margin_start(5)
.margin_end(5)
.build();
mountopts_entry_row_adw_listbox.add_css_class("boxed-list");
let partition_row_expander = adw::ExpanderRow::builder() let partition_row_expander = adw::ExpanderRow::builder()
.subtitle(t!("subtitle_partition")) .subtitle(t!("subtitle_partition"))
.build(); .build();
let mountpoint_entry_row = gtk::Entry::builder() let mountpoint_entry_row = adw::EntryRow::builder()
.placeholder_text(t!("title_mountpoint")) .title(t!("title_mountpoint"))
.hexpand(true) .hexpand(true)
.vexpand(true) .vexpand(true)
.margin_bottom(5) .margin_bottom(5)
@ -79,8 +104,8 @@ impl ObjectImpl for DriveMountRow {
.margin_end(5) .margin_end(5)
.build(); .build();
let mountopts_entry_row = gtk::Entry::builder() let mountopts_entry_row = adw::EntryRow::builder()
.placeholder_text(t!("title_mountopts")) .title(t!("title_mountopts"))
.hexpand(true) .hexpand(true)
.vexpand(true) .vexpand(true)
.margin_bottom(5) .margin_bottom(5)
@ -115,12 +140,21 @@ impl ObjectImpl for DriveMountRow {
) )
); );
//
partition_row_expander_adw_listbox.append(&partition_row_expander); partition_row_expander_adw_listbox.append(&partition_row_expander);
mountpoint_entry_row_adw_listbox.append(&mountpoint_entry_row);
mountopts_entry_row_adw_listbox.append(&mountopts_entry_row);
//
obj.append(&partition_row_expander_adw_listbox); obj.append(&partition_row_expander_adw_listbox);
obj.append(&mountpoint_entry_row); obj.append(&mountpoint_entry_row_adw_listbox);
obj.append(&mountopts_entry_row); obj.append(&mountopts_entry_row_adw_listbox);
obj.append(&partition_row_delete_button); obj.append(&partition_row_delete_button);
@ -130,16 +164,16 @@ impl ObjectImpl for DriveMountRow {
#[weak] #[weak]
partition_row_expander_adw_listbox, partition_row_expander_adw_listbox,
#[weak] #[weak]
mountpoint_entry_row, mountpoint_entry_row_adw_listbox,
#[weak] #[weak]
mountopts_entry_row, mountopts_entry_row_adw_listbox,
move |_| move |_|
{ {
match obj.sizegroup() { match obj.sizegroup() {
Some(t) => { Some(t) => {
t.add_widget(&partition_row_expander_adw_listbox); t.add_widget(&partition_row_expander_adw_listbox);
t.add_widget(&mountpoint_entry_row); t.add_widget(&mountpoint_entry_row_adw_listbox);
t.add_widget(&mountopts_entry_row); t.add_widget(&mountopts_entry_row_adw_listbox);
} }
None => { None => {