[gnome-builder] actions: add action to show the symbols drop down



commit 6e25bed52dc904b0f5cf22ee6ff038a5fdf94ace
Author: Christian Hergert <christian hergert me>
Date:   Tue Apr 7 16:13:17 2015 -0700

    actions: add action to show the symbols drop down
    
    "symbols" from the command bar will now focus the symbol drop down,
    easily allowing you to type/jump to symbol matching the search query.
    
    The search is captive to the current file.

 src/editor/gb-editor-view-actions.c |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)
---
diff --git a/src/editor/gb-editor-view-actions.c b/src/editor/gb-editor-view-actions.c
index 7901936..808a33a 100644
--- a/src/editor/gb-editor-view-actions.c
+++ b/src/editor/gb-editor-view-actions.c
@@ -650,6 +650,20 @@ gb_editor_view_actions_preview (GSimpleAction *action,
     }
 }
 
+static void
+gb_editor_view_actions_show_symbols (GSimpleAction *action,
+                                     GVariant      *param,
+                                     gpointer       user_data)
+{
+  GbEditorView *self = user_data;
+
+  g_assert (G_IS_SIMPLE_ACTION (action));
+  g_assert (GB_IS_EDITOR_VIEW (self));
+
+  if (gtk_widget_get_visible (GTK_WIDGET (self->symbols_button)))
+    g_signal_emit_by_name (self->symbols_button, "activate");
+}
+
 static GActionEntry GbEditorViewActions[] = {
   { "auto-indent", NULL, NULL, "false", gb_editor_view_actions_auto_indent },
   { "close", gb_editor_view_actions_close },
@@ -662,6 +676,7 @@ static GActionEntry GbEditorViewActions[] = {
   { "save-as", gb_editor_view_actions_save_as },
   { "show-line-numbers", NULL, NULL, "false", gb_editor_view_actions_show_line_numbers },
   { "show-right-margin", NULL, NULL, "false", gb_editor_view_actions_show_right_margin },
+  { "symbols", gb_editor_view_actions_show_symbols },
   { "smart-backspace", NULL, NULL, "false", gb_editor_view_actions_smart_backspace },
   { "tab-width", NULL, "i", "8", gb_editor_view_actions_tab_width },
   { "toggle-split", gb_editor_view_actions_toggle_split },


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