[fractal/fractal-next] account-switcher: Close when opening account settings



commit 2cf261f0a542ef26a239b235c37c3f100af15108
Author: Kévin Commaille <zecakeh tedomum fr>
Date:   Wed Dec 22 10:48:35 2021 +0100

    account-switcher: Close when opening account settings
    
    Fixes #839

 src/session/sidebar/account_switcher/mod.rs        | 4 ++++
 src/session/sidebar/account_switcher/user_entry.rs | 1 +
 2 files changed, 5 insertions(+)
---
diff --git a/src/session/sidebar/account_switcher/mod.rs b/src/session/sidebar/account_switcher/mod.rs
index 4df8d414..dc3e470c 100644
--- a/src/session/sidebar/account_switcher/mod.rs
+++ b/src/session/sidebar/account_switcher/mod.rs
@@ -35,6 +35,10 @@ mod imp {
         fn class_init(klass: &mut Self::Class) {
             Self::bind_template(klass);
             klass.set_accessible_role(gtk::AccessibleRole::Dialog);
+
+            klass.install_action("account-switcher.close", None, move |item, _, _| {
+                item.popdown();
+            });
         }
 
         fn instance_init(obj: &InitializingObject<Self>) {
diff --git a/src/session/sidebar/account_switcher/user_entry.rs 
b/src/session/sidebar/account_switcher/user_entry.rs
index 34c33fc4..589b51b6 100644
--- a/src/session/sidebar/account_switcher/user_entry.rs
+++ b/src/session/sidebar/account_switcher/user_entry.rs
@@ -36,6 +36,7 @@ mod imp {
                 "user-entry-row.open-account-settings",
                 None,
                 move |item, _, _| {
+                    item.activate_action("account-switcher.close", None);
                     item.show_account_settings();
                 },
             );


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]