[gnome-builder/search: 3/3] workbench: display popover when focusing search entry
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder/search: 3/3] workbench: display popover when focusing search entry
- Date: Sun, 14 Dec 2014 22:01:34 +0000 (UTC)
commit 4ef2c898eee0edcb817f6cb6f753e8d19b4b7a08
Author: Christian Hergert <christian hergert me>
Date: Sun Dec 14 14:00:56 2014 -0800
workbench: display popover when focusing search entry
src/workbench/gb-workbench.c | 19 +++++++++++++++++++
1 files changed, 19 insertions(+), 0 deletions(-)
---
diff --git a/src/workbench/gb-workbench.c b/src/workbench/gb-workbench.c
index 5d77c2a..aa68477 100644
--- a/src/workbench/gb-workbench.c
+++ b/src/workbench/gb-workbench.c
@@ -596,6 +596,19 @@ gb_workbench_set_focus (GtkWindow *window,
}
static void
+gb_workbench_search_entry_focus_in (GbWorkbench *workbench,
+ GdkEventFocus *event,
+ GtkWidget *search_entry)
+{
+ g_return_if_fail (GB_IS_WORKBENCH (workbench));
+ g_return_if_fail (event);
+ g_return_if_fail (GTK_IS_SEARCH_ENTRY (search_entry));
+
+ gtk_toggle_button_set_active (
+ GTK_TOGGLE_BUTTON (workbench->priv->search_menu_button), TRUE);
+}
+
+static void
gb_workbench_constructed (GObject *object)
{
static const GActionEntry actions[] = {
@@ -661,6 +674,12 @@ gb_workbench_constructed (GObject *object)
workbench,
G_CONNECT_SWAPPED);
+ g_signal_connect_object (priv->search_entry,
+ "focus-in-event",
+ G_CALLBACK (gb_workbench_search_entry_focus_in),
+ workbench,
+ G_CONNECT_SWAPPED);
+
gb_workbench_stack_child_changed (workbench, NULL, priv->stack);
EXIT;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]