[gnome-builder/wip/chergert/shortcuts] wip: set the title when changing views



commit 378cbc594473ab8629efaae476b7c1c4a2cdd233
Author: Christian Hergert <christian hergert me>
Date:   Wed Aug 26 00:28:18 2015 -0700

    wip: set the title when changing views

 src/keybindings/gb-shortcuts-window.c |   15 ++++++++++++++-
 1 files changed, 14 insertions(+), 1 deletions(-)
---
diff --git a/src/keybindings/gb-shortcuts-window.c b/src/keybindings/gb-shortcuts-window.c
index 4a2fafc..c899800 100644
--- a/src/keybindings/gb-shortcuts-window.c
+++ b/src/keybindings/gb-shortcuts-window.c
@@ -40,9 +40,22 @@ static void
 gb_shortcuts_window_set_view (GbShortcutsWindow *self,
                               const gchar       *name)
 {
+  GtkWidget *child;
+
   g_assert (GB_IS_SHORTCUTS_WINDOW (self));
 
-  gtk_stack_set_visible_child_name (self->stack, name);
+  child = gtk_stack_get_child_by_name (self->stack, name);
+
+  if (child != NULL)
+    {
+      g_autofree gchar *title = NULL;
+
+      gtk_container_child_get (GTK_CONTAINER (self->stack), child,
+                               "title", &title,
+                               NULL);
+      gtk_button_set_label (GTK_BUTTON (self->menu_button), title);
+      gtk_stack_set_visible_child (self->stack, child);
+    }
 }
 
 static void


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