[gnome-builder] editor: hide search bar upon receiving stop-search
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] editor: hide search bar upon receiving stop-search
- Date: Tue, 25 Jul 2017 01:33:35 +0000 (UTC)
commit 2808a08a1efacf180fab3d94df5824f29029ca5e
Author: Christian Hergert <chergert redhat com>
Date: Mon Jul 24 18:33:13 2017 -0700
editor: hide search bar upon receiving stop-search
libide/editor/ide-editor-view.c | 12 ++++++++++++
libide/editor/ide-editor-view.ui | 1 +
2 files changed, 13 insertions(+), 0 deletions(-)
---
diff --git a/libide/editor/ide-editor-view.c b/libide/editor/ide-editor-view.c
index 5a04af7..a96b268 100644
--- a/libide/editor/ide-editor-view.c
+++ b/libide/editor/ide-editor-view.c
@@ -92,6 +92,17 @@ ide_editor_view_load_fonts (IdeEditorView *self)
}
static void
+ide_editor_view_stop_search (IdeEditorView *self,
+ IdeEditorSearchBar *search_bar)
+{
+ g_assert (IDE_IS_EDITOR_VIEW (self));
+ g_assert (IDE_IS_EDITOR_SEARCH_BAR (search_bar));
+
+ gtk_revealer_set_reveal_child (self->search_revealer, FALSE);
+ gtk_widget_grab_focus (GTK_WIDGET (self->source_view));
+}
+
+static void
ide_editor_view_notify_child_revealed (IdeEditorView *self,
GParamSpec *pspec,
GtkRevealer *revealer)
@@ -712,6 +723,7 @@ ide_editor_view_class_init (IdeEditorViewClass *klass)
gtk_widget_class_bind_template_child (widget_class, IdeEditorView, search_revealer);
gtk_widget_class_bind_template_child (widget_class, IdeEditorView, source_view);
gtk_widget_class_bind_template_callback (widget_class, ide_editor_view_notify_child_revealed);
+ gtk_widget_class_bind_template_callback (widget_class, ide_editor_view_stop_search);
g_type_ensure (IDE_TYPE_SOURCE_VIEW);
g_type_ensure (IDE_TYPE_EDITOR_SEARCH_BAR);
diff --git a/libide/editor/ide-editor-view.ui b/libide/editor/ide-editor-view.ui
index f477530..aa65852 100644
--- a/libide/editor/ide-editor-view.ui
+++ b/libide/editor/ide-editor-view.ui
@@ -15,6 +15,7 @@
<child>
<object class="IdeEditorSearchBar" id="search_bar">
<property name="visible">true</property>
+ <signal name="stop-search" handler="ide_editor_view_stop_search" swapped="true"
object="IdeEditorView"/>
</object>
</child>
</object>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]