[gnome-builder/wip/chergert/completion] editor: add toggle-map action



commit 4107ae248377f838dd82bd97184fcf1268d45c8f
Author: Christian Hergert <chergert redhat com>
Date:   Wed Jun 6 14:16:14 2018 -0700

    editor: add toggle-map action
    
    This allows the map to be quickly enabled/disabled on a per-view basis
    using "toggle-map" from the command bar.

 src/libide/editor/ide-editor-view-actions.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
---
diff --git a/src/libide/editor/ide-editor-view-actions.c b/src/libide/editor/ide-editor-view-actions.c
index 6b7eb882e..c60236c24 100644
--- a/src/libide/editor/ide-editor-view-actions.c
+++ b/src/libide/editor/ide-editor-view-actions.c
@@ -538,6 +538,19 @@ ide_editor_view_actions_properties (GSimpleAction *action,
   _ide_editor_perspective_show_properties (IDE_EDITOR_PERSPECTIVE (editor), self);
 }
 
+static void
+ide_editor_view_actions_toggle_map (GSimpleAction *action,
+                                    GVariant      *variant,
+                                    gpointer       user_data)
+{
+  IdeEditorView *self = user_data;
+
+  g_assert (G_IS_SIMPLE_ACTION (action));
+  g_assert (IDE_IS_EDITOR_VIEW (self));
+
+  ide_editor_view_set_show_map (self, !ide_editor_view_get_show_map (self));
+}
+
 static const GActionEntry editor_view_entries[] = {
   { "activate-next-search-result", ide_editor_view_actions_activate_next_search_result },
   { "find", ide_editor_view_actions_find },
@@ -552,6 +565,7 @@ static const GActionEntry editor_view_entries[] = {
   { "reload", ide_editor_view_actions_reload },
   { "save", ide_editor_view_actions_save },
   { "save-as", ide_editor_view_actions_save_as },
+  { "toggle-map", ide_editor_view_actions_toggle_map },
 };
 
 void


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