allow window to run in background

This commit is contained in:
Ward from fusion-voyager-3 2024-10-01 23:09:56 +03:00
parent d6e1e16594
commit c7b38d2dfe

View File

@ -165,6 +165,8 @@ pub fn build_ui(app: &Application) {
// Startup // Startup
.startup_id(APP_ID) .startup_id(APP_ID)
// build the window // build the window
.hide_on_close(true)
//
.build(); .build();
window.add_breakpoint(window_breakpoint); window.add_breakpoint(window_breakpoint);
@ -210,7 +212,7 @@ pub fn build_ui(app: &Application) {
// show the window // show the window
window.present(); //window.present();
// Flatpak Update Page // Flatpak Update Page
@ -299,7 +301,7 @@ pub fn build_ui(app: &Application) {
window_adw_view_switcher_sidebar_box.append(&apt_manage_page_toggle_button); window_adw_view_switcher_sidebar_box.append(&apt_manage_page_toggle_button);
window_adw_stack.add_titled( window_adw_stack.add_titled(
&flatpak_manage_page(window, &flatpak_retry_signal_action), &flatpak_manage_page(window.clone(), &flatpak_retry_signal_action),
Some("flatpak_manage_page"), Some("flatpak_manage_page"),
&t!("flatpak_manage_page_title"), &t!("flatpak_manage_page_title"),
); );
@ -312,6 +314,8 @@ pub fn build_ui(app: &Application) {
apt_manage_page_toggle_button, apt_manage_page_toggle_button,
#[strong] #[strong]
flatpak_manage_page_toggle_button, flatpak_manage_page_toggle_button,
#[strong]
window,
move |_, cmdline| { move |_, cmdline| {
// Create Vec from cmdline // Create Vec from cmdline
let mut gtk_application_args = Vec::new(); let mut gtk_application_args = Vec::new();
@ -323,6 +327,9 @@ pub fn build_ui(app: &Application) {
} }
// Check for cmd lines // Check for cmd lines
if !(gtk_application_args.contains(&"--hidden".to_string())) && !window.is_visible() {
window.present();
}
if gtk_application_args.contains(&"--software-properties".to_string()) { if gtk_application_args.contains(&"--software-properties".to_string()) {
apt_manage_page_toggle_button.set_active(true); apt_manage_page_toggle_button.set_active(true);