[gnome-builder] view: bring back goto definition
- From: Sébastien Lafargue <slafargue src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] view: bring back goto definition
- Date: Thu, 17 Aug 2017 20:02:32 +0000 (UTC)
commit 70ca315610fa1dd6f121545a3e25d4846a3325cf
Author: Sebastien Lafargue <slafargue gnome org>
Date: Thu Aug 17 22:01:42 2017 +0200
view: bring back goto definition
We lost this in the UI revamp
libide/editor/ide-editor-view.c | 25 +++++++++++++++++++++++++
1 files changed, 25 insertions(+), 0 deletions(-)
---
diff --git a/libide/editor/ide-editor-view.c b/libide/editor/ide-editor-view.c
index a8623ce..904130f 100644
--- a/libide/editor/ide-editor-view.c
+++ b/libide/editor/ide-editor-view.c
@@ -544,6 +544,24 @@ search_revealer_notify_reveal_child (IdeEditorView *self,
}
static void
+ide_editor_view_focus_location (IdeEditorView *self,
+ IdeSourceLocation *location,
+ IdeSourceView *source_view)
+{
+ IdeWorkbench *workbench;
+ IdePerspective *editor;
+
+ g_assert (IDE_IS_EDITOR_VIEW (self));
+ g_assert (location != NULL);
+ g_assert (IDE_IS_SOURCE_VIEW (source_view));
+
+ workbench = ide_widget_get_workbench (GTK_WIDGET (self));
+ editor = ide_workbench_get_perspective_by_name (workbench, "editor");
+
+ ide_editor_perspective_focus_location (IDE_EDITOR_PERSPECTIVE (editor), location);
+}
+
+static void
ide_editor_view_constructed (GObject *object)
{
IdeEditorView *self = (IdeEditorView *)object;
@@ -586,11 +604,18 @@ ide_editor_view_constructed (GObject *object)
G_CALLBACK (ide_editor_view_source_view_event),
self);
+ g_signal_connect_swapped (self->source_view,
+ "focus-location",
+ G_CALLBACK (ide_editor_view_focus_location),
+ self);
+
g_signal_connect_swapped (self->map,
"motion-notify-event",
G_CALLBACK (ide_editor_view_source_view_event),
self);
+
+
/*
* We want to track when the search revealer is visible. We will discard
* the search context when the revealer is not visible so that we don't
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]