diff options
author | Alexander Mikhaylenko <alexm@gnome.org> | 2022-08-12 17:19:11 +0400 |
---|---|---|
committer | Niels De Graef <nielsdegraef@gmail.com> | 2022-08-12 16:32:24 +0000 |
commit | 9094c98fc3f85da0ad03aeec52f511c584ca2401 (patch) | |
tree | 9b71d6853dbbc925a31b9ca05f2703a3eeb99bca /src/contacts-contact-pane.vala | |
parent | 63da3cc0ed8a1475737904017dbfcd01ed083602 (diff) | |
download | gnome-contacts-9094c98fc3f85da0ad03aeec52f511c584ca2401.tar.gz |
Fix unselecting sidebar item
Multiple things here.
- The selection model state was mever synced back to the list
- The selected == null codepath didn't work
- unselect_all() does nothing with GtkSingleSelection
- gtk_list_box_unselect_all() does nothing with BROWSE selection mode
Fixes https://gitlab.gnome.org/GNOME/gnome-contacts/-/issues/262
Diffstat (limited to 'src/contacts-contact-pane.vala')
-rw-r--r-- | src/contacts-contact-pane.vala | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/contacts-contact-pane.vala b/src/contacts-contact-pane.vala index 5cbbc84..b375a9c 100644 --- a/src/contacts-contact-pane.vala +++ b/src/contacts-contact-pane.vala @@ -238,7 +238,7 @@ public class Contacts.ContactPane : Adw.Bin { persona = yield primary_store.add_persona_from_details (details); } catch (Error e) { show_message_dialog (_("Unable to create new contacts: %s").printf (e.message)); - this.store.selection.unselect_all (); + this.store.selection.unselect_item (this.store.selection.get_selected ()); return; } @@ -253,7 +253,7 @@ public class Contacts.ContactPane : Adw.Bin { // If we got here, we couldn't find the individual show_message_dialog (_("Unable to find newly created contact")); - this.store.selection.unselect_all (); + this.store.selection.unselect_item (this.store.selection.get_selected ()); } private void show_message_dialog (string message) { |