fix some ui margins

This commit is contained in:
Ward from fusion-voyager-3 2024-07-09 09:13:09 +03:00
parent 86e58e1a29
commit f3751ab535
4 changed files with 27 additions and 12 deletions

View File

@ -8,6 +8,7 @@
</component> </component>
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="df2ca9e1-e07d-43f4-bc68-0a6113fc1fa2" name="Changes" comment=""> <list default="true" id="df2ca9e1-e07d-43f4-bc68-0a6113fc1fa2" name="Changes" comment="">
<change afterPath="$PROJECT_DIR$/src/apt_update_page/process.rs" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" /> <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/apt_update_page/mod.rs" beforeDir="false" afterPath="$PROJECT_DIR$/src/apt_update_page/mod.rs" afterDir="false" /> <change beforePath="$PROJECT_DIR$/src/apt_update_page/mod.rs" beforeDir="false" afterPath="$PROJECT_DIR$/src/apt_update_page/mod.rs" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/build_ui/mod.rs" beforeDir="false" afterPath="$PROJECT_DIR$/src/build_ui/mod.rs" afterDir="false" /> <change beforePath="$PROJECT_DIR$/src/build_ui/mod.rs" beforeDir="false" afterPath="$PROJECT_DIR$/src/build_ui/mod.rs" afterDir="false" />
@ -112,7 +113,7 @@
<workItem from="1720301553869" duration="12211000" /> <workItem from="1720301553869" duration="12211000" />
<workItem from="1720423242486" duration="3396000" /> <workItem from="1720423242486" duration="3396000" />
<workItem from="1720476457389" duration="7123000" /> <workItem from="1720476457389" duration="7123000" />
<workItem from="1720502207843" duration="1286000" /> <workItem from="1720502207843" duration="3142000" />
</task> </task>
<servers /> <servers />
</component> </component>

View File

@ -1,3 +1,5 @@
mod process;
use std::rc::Rc; use std::rc::Rc;
use crate::apt_package_row::AptPackageRow; use crate::apt_package_row::AptPackageRow;
use adw::gio::{Action, SimpleAction}; use adw::gio::{Action, SimpleAction};
@ -43,6 +45,8 @@ pub fn apt_update_page(window: adw::ApplicationWindow, retry_signal_action: &Sim
let (get_upgradable_sender, get_upgradable_receiver) = async_channel::unbounded(); let (get_upgradable_sender, get_upgradable_receiver) = async_channel::unbounded();
let get_upgradable_sender = get_upgradable_sender.clone(); let get_upgradable_sender = get_upgradable_sender.clone();
//let excluded_updates_vec = Vec::new();
thread::spawn(move || { thread::spawn(move || {
Runtime::new() Runtime::new()
.unwrap() .unwrap()
@ -87,8 +91,6 @@ pub fn apt_update_page(window: adw::ApplicationWindow, retry_signal_action: &Sim
let packages_boxedlist = gtk::ListBox::builder() let packages_boxedlist = gtk::ListBox::builder()
.selection_mode(SelectionMode::None) .selection_mode(SelectionMode::None)
.margin_bottom(15)
.margin_start(15)
.margin_end(15) .margin_end(15)
.margin_start(15) .margin_start(15)
.sensitive(false) .sensitive(false)
@ -101,7 +103,7 @@ pub fn apt_update_page(window: adw::ApplicationWindow, retry_signal_action: &Sim
.vexpand(true) .vexpand(true)
.hexpand(true) .hexpand(true)
.margin_bottom(15) .margin_bottom(15)
.margin_start(15) .margin_top(15)
.margin_end(15) .margin_end(15)
.margin_start(15) .margin_start(15)
.height_request(390) .height_request(390)
@ -163,8 +165,7 @@ pub fn apt_update_page(window: adw::ApplicationWindow, retry_signal_action: &Sim
.valign(Align::Center) .valign(Align::Center)
.hexpand(true) .hexpand(true)
.margin_start(10) .margin_start(10)
.margin_end(30) .margin_end(10)
.margin_top(2)
.margin_bottom(15) .margin_bottom(15)
.label(t!("select_button_deselect_all")) .label(t!("select_button_deselect_all"))
.build(); .build();
@ -181,7 +182,19 @@ pub fn apt_update_page(window: adw::ApplicationWindow, retry_signal_action: &Sim
set_all_apt_row_marks_to(&packages_boxedlist, value_to_mark) set_all_apt_row_marks_to(&packages_boxedlist, value_to_mark)
})); }));
let update_button = gtk::Button::builder()
.halign(Align::End)
.valign(Align::Center)
.hexpand(false)
.margin_start(10)
.margin_end(30)
.margin_bottom(15)
.label(t!("update_button_label"))
.build();
update_button.add_css_class("destructive-action");
bottom_bar.append(&select_button); bottom_bar.append(&select_button);
bottom_bar.append(&update_button);
let update_percent_server_context = MainContext::default(); let update_percent_server_context = MainContext::default();
// The main loop executes the asynchronous block // The main loop executes the asynchronous block

View File

View File

@ -111,7 +111,8 @@ pub fn build_ui(app: &adw::Application) {
.build(); .build();
let refresh_button = gtk::Button::builder() let refresh_button = gtk::Button::builder()
.label(t!("refresh_button_label")) .icon_name("view-refresh-symbolic")
.tooltip_text(t!("refresh_button_tooltip_text"))
.build(); .build();
let credits_window = adw::AboutWindow::builder() let credits_window = adw::AboutWindow::builder()
@ -135,7 +136,6 @@ pub fn build_ui(app: &adw::Application) {
window.present(); window.present();
// Apt Update Page // Apt Update Page
let apt_retry_signal_action = gio::SimpleAction::new("retry", None); let apt_retry_signal_action = gio::SimpleAction::new("retry", None);
let apt_update_view_stack_bin = adw::Bin::builder() let apt_update_view_stack_bin = adw::Bin::builder()
@ -147,11 +147,12 @@ pub fn build_ui(app: &adw::Application) {
})); }));
window_adw_view_stack.add_titled_with_icon(&apt_update_view_stack_bin, Some("apt_update_page"), &t!("apt_update_page_title"), "software-update-available-symbolic"); window_adw_view_stack.add_titled_with_icon(&apt_update_view_stack_bin, Some("apt_update_page"), &t!("apt_update_page_title"), "software-update-available-symbolic");
window_adw_view_stack.add_titled(&gtk::Image::builder().icon_name("firefox").build(), Some("apt_update_page2"), &t!("apt_update_page_title2"));
// //
refresh_button.connect_clicked(clone!(@weak apt_retry_signal_action => move |_| { refresh_button.connect_clicked(clone!(@weak apt_retry_signal_action, @weak window_adw_view_stack => move |_| {
apt_retry_signal_action.activate(None); match window_adw_view_stack.visible_child_name().unwrap().as_str() {
"apt_update_page" => apt_retry_signal_action.activate(None),
_ => {}
}
})); }));
} }