[gnome-contacts/nielsdg/new-operations] main-window: Don't show an almost-hidden contact




commit 0307d5561cc0bbb648a59d54adde6e94954402f9
Author: Niels De Graef <nielsdegraef gmail com>
Date:   Sun Jun 5 15:24:15 2022 +0200

    main-window: Don't show an almost-hidden contact
    
    Whenever we're on the verge of linking several contacts or deleting a
    contact, we should stop showing that contact.

 src/contacts-main-window.vala | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
---
diff --git a/src/contacts-main-window.vala b/src/contacts-main-window.vala
index 8d460dee..a2fdffb7 100644
--- a/src/contacts-main-window.vala
+++ b/src/contacts-main-window.vala
@@ -293,6 +293,7 @@ public class Contacts.MainWindow : Adw.ApplicationWindow {
       return;
 
     this.contacts_list.set_contacts_visible (selection, false);
+    this.contact_pane.show_contact (null);
     delete_contacts (selection);
   }
 
@@ -459,6 +460,7 @@ public class Contacts.MainWindow : Adw.ApplicationWindow {
     this.store.selection.unselect_all ();
     this.marked_contacts.unselect_all ();
     this.contacts_list.set_contacts_visible (selection, false);
+    this.contact_pane.show_contact (null);
     this.state = UiState.NORMAL;
 
     // Build the list of contacts
@@ -489,6 +491,7 @@ public class Contacts.MainWindow : Adw.ApplicationWindow {
     this.store.selection.unselect_all ();
     this.marked_contacts.unselect_all ();
     this.contacts_list.set_contacts_visible (selection, false);
+    this.contact_pane.show_contact (null);
     this.state = UiState.NORMAL;
 
     var individuals = bitset_to_individuals (this.store.filter_model,
@@ -500,7 +503,6 @@ public class Contacts.MainWindow : Adw.ApplicationWindow {
     var cancellable = new Cancellable ();
     cancellable.cancelled.connect ((c) => {
       this.contacts_list.set_contacts_visible (selection, true);
-      this.state = UiState.SHOWING;
     });
 
     var toast = add_toast_for_operation (op, "win.cancel-operation", _("_Cancel"));


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