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.
This commit is contained in:
Iain Lane 2019-02-14 13:42:03 +00:00
parent 19e42fb051
commit 82191ca285
No known key found for this signature in database
GPG key ID: E352D5C51C5041D4

View file

@ -807,6 +807,11 @@ cc_window_constructed (GObject *object)
else
cc_panel_list_activate (CC_PANEL_LIST (self->panel_list));
g_signal_connect_swapped (self->panel_list,
"notify::view",
G_CALLBACK (update_headerbar_buttons),
self);
update_headerbar_buttons (self);
G_OBJECT_CLASS (cc_window_parent_class)->constructed (object);