[gnome-control-center/iainl/sidebar-avoid-getting-stuck] window: Update the headerbar when the panel list changes



commit e8bb4a2090a02a9958cfc5411dd2e769680afb58
Author: Iain Lane <iainl gnome org>
Date:   Thu Feb 14 13:42:03 2019 +0000

    window: Update the headerbar when the panel list changes
    
    Currently you can get stuck in the applications panel if you do this:
    
      1) Click "Applications" in the sidebar. The top left icon is a back
         icon.
      2) Click the back icon to return to the panel list. The top left icon
         changes to a search icon.
      3) Click "Applications" again. The top left icon remains a search icon
         and you're stuck in the panel.
    
    The basic problem is that the headebar icon is update when the panel
    changes, but not when the sidebar view changes. To fix this, we connect
    to the signal that is emitted when the sidebar view changes, and update
    the headerbar.

 shell/cc-window.c | 5 +++++
 1 file changed, 5 insertions(+)
---
diff --git a/shell/cc-window.c b/shell/cc-window.c
index 9704a3c7f..e6d93647c 100644
--- a/shell/cc-window.c
+++ b/shell/cc-window.c
@@ -807,6 +807,11 @@ cc_window_constructed (GObject *object)
   else
     cc_panel_list_activate (CC_PANEL_LIST (self->panel_list));
 
+  g_signal_connect_swapped (CC_PANEL_LIST (self->panel_list),
+                            "notify::view",
+                            G_CALLBACK (update_headerbar_buttons),
+                            self);
+
   update_headerbar_buttons (self);
 
   G_OBJECT_CLASS (cc_window_parent_class)->constructed (object);


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