[gnome-builder/wip/chergert/headerbar] editor: proxy panel actions to perspective actions



commit 3e407a39b382e4627b2d3f91cacd7b5ebe6db96d
Author: Christian Hergert <chergert redhat com>
Date:   Wed Jun 22 21:14:42 2016 -0700

    editor: proxy panel actions to perspective actions

 libide/editor/ide-editor-perspective.c |   19 +++++++++++++++++--
 1 files changed, 17 insertions(+), 2 deletions(-)
---
diff --git a/libide/editor/ide-editor-perspective.c b/libide/editor/ide-editor-perspective.c
index cfdce09..e66000a 100644
--- a/libide/editor/ide-editor-perspective.c
+++ b/libide/editor/ide-editor-perspective.c
@@ -402,12 +402,20 @@ ide_editor_perspective_class_init (IdeEditorPerspectiveClass *klass)
 static void
 ide_editor_perspective_init (IdeEditorPerspective *self)
 {
-  GActionGroup *actions;
+  static const gchar *proxy_actions[] = {
+    "bottom-visible",
+    "left-visible",
+    "right-visible",
+    NULL
+  };
   static const GActionEntry entries[] = {
     { "new-file", new_file_activate },
     { "global-search", global_search_activate },
   };
 
+  GActionGroup *actions;
+  guint i;
+
   self->buffer_manager_signals = egg_signal_group_new (IDE_TYPE_BUFFER_MANAGER);
 
   egg_signal_group_connect_object (self->buffer_manager_signals,
@@ -434,7 +442,14 @@ ide_editor_perspective_init (IdeEditorPerspective *self)
                                    G_N_ELEMENTS (entries), self);
 
   actions = gtk_widget_get_action_group (GTK_WIDGET (self), "dockbin");
-  gtk_widget_insert_action_group (GTK_WIDGET (self->titlebar), "dockbin", actions);
+
+  for (i = 0; proxy_actions[i]; i++)
+    {
+      GAction *action;
+
+      action = g_action_map_lookup_action (G_ACTION_MAP (actions), proxy_actions[i]);
+      g_action_map_add_action (G_ACTION_MAP (self->actions), action);
+    }
 
   ide_editor_perspective_restore_panel_state (self);
 


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