[gnome-builder/search] GbSearchBox: hide popover and clear text upon result activation
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder/search] GbSearchBox: hide popover and clear text upon result activation
- Date: Tue, 16 Dec 2014 00:52:15 +0000 (UTC)
commit f3294a46deb0769e1fef31bc79dd35c5aa689d0d
Author: Christian Hergert <christian hergert me>
Date: Mon Dec 15 16:51:36 2014 -0800
GbSearchBox: hide popover and clear text upon result activation
src/search/gb-search-box.c | 18 ++++++++++++++++++
1 files changed, 18 insertions(+), 0 deletions(-)
---
diff --git a/src/search/gb-search-box.c b/src/search/gb-search-box.c
index 090b773..ce65649 100644
--- a/src/search/gb-search-box.c
+++ b/src/search/gb-search-box.c
@@ -183,6 +183,19 @@ gb_search_box_entry_key_press_event (GbSearchBox *box,
}
static void
+gb_search_box_display_result_activated (GbSearchBox *box,
+ GbSearchResult *result,
+ GbSearchDisplay *display)
+{
+ g_return_if_fail (GB_IS_SEARCH_BOX (box));
+ g_return_if_fail (GB_IS_SEARCH_RESULT (result));
+ g_return_if_fail (GB_IS_SEARCH_DISPLAY (display));
+
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (box->priv->button), FALSE);
+ gtk_entry_set_text (GTK_ENTRY (box->priv->entry), "");
+}
+
+static void
gb_search_box_grab_focus (GtkWidget *widget)
{
GbSearchBox *box = (GbSearchBox *)widget;
@@ -226,6 +239,11 @@ gb_search_box_constructed (GObject *object)
G_CALLBACK (gb_search_box_entry_key_press_event),
self,
G_CONNECT_SWAPPED);
+ g_signal_connect_object (priv->display,
+ "result-activated",
+ G_CALLBACK (gb_search_box_display_result_activated),
+ self,
+ G_CONNECT_SWAPPED);
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]