From cd143d3bd5c7be5f97ff94e3d6d4b91b857f4dfc Mon Sep 17 00:00:00 2001 From: Ward from fusion-voyager-3 Date: Thu, 19 Sep 2024 21:48:06 +0300 Subject: [PATCH] begin working on add buttons --- src/bin/gui/apt_manage_page/mod.rs | 40 ++++++++++++++++++++++++------ 1 file changed, 33 insertions(+), 7 deletions(-) diff --git a/src/bin/gui/apt_manage_page/mod.rs b/src/bin/gui/apt_manage_page/mod.rs index b52d328..d2037a2 100644 --- a/src/bin/gui/apt_manage_page/mod.rs +++ b/src/bin/gui/apt_manage_page/mod.rs @@ -151,10 +151,6 @@ pub fn apt_manage_page( */ let unofficial_sources_columnview = ColumnView::builder() - .margin_bottom(3) - .margin_top(3) - .margin_end(3) - .margin_start(3) .vexpand(true) .model(&unofficial_sources_selection_model) .build(); @@ -271,8 +267,8 @@ pub fn apt_manage_page( unofficial_sources_columnview.append_column(&unofficial_sources_columnview_col0); unofficial_sources_columnview.append_column(&unofficial_sources_columnview_col1); - let unofficial_sources_boxedlist = ListBox::builder() - .selection_mode(SelectionMode::None) + let unofficial_sources_box = Box::builder() + .orientation(Orientation::Vertical) .margin_bottom(3) .margin_top(3) .margin_end(3) @@ -287,13 +283,43 @@ pub fn apt_manage_page( .margin_top(15) .margin_end(15) .margin_start(15) - .child(&unofficial_sources_columnview) + .child(&unofficial_sources_box) .height_request(390) .build(); unofficial_sources_viewport.add_css_class("round-all-scroll"); // + let unofficial_sources_edit_box = gtk::Box::builder() + .orientation(Orientation::Horizontal) + .homogeneous(true) + .build(); + unofficial_sources_edit_box.add_css_class("linked"); + + let unofficial_source_edit_button = Button::builder() + .icon_name("document-edit-symbolic") + .tooltip_text(t!("unofficial_source_edit_button")) + //.halign(Align::End) + .valign(Align::End) + .build(); + + let unofficial_source_add_button = Button::builder() + .icon_name("list-add-symbolic") + .tooltip_text(t!("unofficial_source_add_button")) + //.halign(Align::End) + .valign(Align::End) + .build(); + + // + + unofficial_sources_edit_box.append(&unofficial_source_add_button); + unofficial_sources_edit_box.append(&unofficial_source_edit_button); + + unofficial_sources_box.append(&unofficial_sources_columnview); + unofficial_sources_box.append(&unofficial_sources_edit_box); + + // + main_box.append(&system_mirror_label0); main_box.append(&system_mirror_label1); main_box.append(&system_mirror_entry);