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 name="ChangeListManager">
<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$/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" />
@ -112,7 +113,7 @@
<workItem from="1720301553869" duration="12211000" />
<workItem from="1720423242486" duration="3396000" />
<workItem from="1720476457389" duration="7123000" />
<workItem from="1720502207843" duration="1286000" />
<workItem from="1720502207843" duration="3142000" />
</task>
<servers />
</component>

View File

@ -1,3 +1,5 @@
mod process;
use std::rc::Rc;
use crate::apt_package_row::AptPackageRow;
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_sender.clone();
//let excluded_updates_vec = Vec::new();
thread::spawn(move || {
Runtime::new()
.unwrap()
@ -87,8 +91,6 @@ pub fn apt_update_page(window: adw::ApplicationWindow, retry_signal_action: &Sim
let packages_boxedlist = gtk::ListBox::builder()
.selection_mode(SelectionMode::None)
.margin_bottom(15)
.margin_start(15)
.margin_end(15)
.margin_start(15)
.sensitive(false)
@ -101,7 +103,7 @@ pub fn apt_update_page(window: adw::ApplicationWindow, retry_signal_action: &Sim
.vexpand(true)
.hexpand(true)
.margin_bottom(15)
.margin_start(15)
.margin_top(15)
.margin_end(15)
.margin_start(15)
.height_request(390)
@ -163,8 +165,7 @@ pub fn apt_update_page(window: adw::ApplicationWindow, retry_signal_action: &Sim
.valign(Align::Center)
.hexpand(true)
.margin_start(10)
.margin_end(30)
.margin_top(2)
.margin_end(10)
.margin_bottom(15)
.label(t!("select_button_deselect_all"))
.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)
}));
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(&update_button);
let update_percent_server_context = MainContext::default();
// The main loop executes the asynchronous block

View File

View File

@ -111,7 +111,8 @@ pub fn build_ui(app: &adw::Application) {
.build();
let refresh_button = gtk::Button::builder()
.label(t!("refresh_button_label"))
.icon_name("view-refresh-symbolic")
.tooltip_text(t!("refresh_button_tooltip_text"))
.build();
let credits_window = adw::AboutWindow::builder()
@ -135,7 +136,6 @@ pub fn build_ui(app: &adw::Application) {
window.present();
// Apt Update Page
let apt_retry_signal_action = gio::SimpleAction::new("retry", None);
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(&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 |_| {
apt_retry_signal_action.activate(None);
refresh_button.connect_clicked(clone!(@weak apt_retry_signal_action, @weak window_adw_view_stack => move |_| {
match window_adw_view_stack.visible_child_name().unwrap().as_str() {
"apt_update_page" => apt_retry_signal_action.activate(None),
_ => {}
}
}));
}