[gnome-contacts] contacts-main-window: cancelling selection no longer hides headerbar buttons



commit dce22456c4e274a4e118a85477ec2167fee5fe08
Author: Eric Daigle <daigle e outlook com>
Date:   Tue Feb 9 00:28:38 2021 -0500

    contacts-main-window: cancelling selection no longer hides headerbar buttons
    
    As described in #184, selecting a contact and then exiting selection mode
    by pressing the cancel button causes the favorite and menu buttons to disappear.
    
    To fix this, the make  cancel button's callback change the UiState to SHOWING
    rather than NORMAL if a contact is currently selected. The headerbar buttons
    then remain displayed as expected.
    
    Closes #184

 src/contacts-main-window.vala | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
---
diff --git a/src/contacts-main-window.vala b/src/contacts-main-window.vala
index 94c793f7..932f7b1f 100644
--- a/src/contacts-main-window.vala
+++ b/src/contacts-main-window.vala
@@ -425,7 +425,13 @@ public class Contacts.MainWindow : Hdy.ApplicationWindow {
   }
 
   private void connect_button_signals () {
-    this.select_cancel_button.clicked.connect (() => { this.state = UiState.NORMAL; });
+    this.select_cancel_button.clicked.connect (() => {
+        if (this.contact_pane.individual != null) {
+            this.state = UiState.SHOWING;
+        } else {
+            this.state = UiState.NORMAL;
+        }
+    });
     this.done_button.clicked.connect (() => stop_editing ());
     this.cancel_button.clicked.connect (() => stop_editing (true));
 


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