[gnome-builder/document-manager] stack: focus open buffer search with <Control>J
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder/document-manager] stack: focus open buffer search with <Control>J
- Date: Mon, 8 Dec 2014 21:45:36 +0000 (UTC)
commit e88904d7eac8def3b3171a244ba4f4323636c5b3
Author: Christian Hergert <christian hergert me>
Date: Mon Dec 8 13:45:31 2014 -0800
stack: focus open buffer search with <Control>J
src/documents/gb-document-menu-button.c | 9 +++++++++
src/documents/gb-document-menu-button.h | 1 +
src/documents/gb-document-stack.c | 13 +++++++++++++
3 files changed, 23 insertions(+), 0 deletions(-)
---
diff --git a/src/documents/gb-document-menu-button.c b/src/documents/gb-document-menu-button.c
index fb2bf88..1928c5e 100644
--- a/src/documents/gb-document-menu-button.c
+++ b/src/documents/gb-document-menu-button.c
@@ -522,6 +522,15 @@ gb_document_menu_button_clicked (GtkButton *button)
GTK_BUTTON_CLASS (gb_document_menu_button_parent_class)->clicked (button);
}
+void
+gb_document_menu_button_focus_search (GbDocumentMenuButton *button)
+{
+ g_return_if_fail (GB_IS_DOCUMENT_MENU_BUTTON (button));
+
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), TRUE);
+ gtk_widget_grab_focus (GTK_WIDGET (button->priv->search_entry));
+}
+
static void
gb_document_menu_button_constructed (GObject *object)
{
diff --git a/src/documents/gb-document-menu-button.h b/src/documents/gb-document-menu-button.h
index 116c346..de4a24d 100644
--- a/src/documents/gb-document-menu-button.h
+++ b/src/documents/gb-document-menu-button.h
@@ -61,6 +61,7 @@ void gb_document_menu_button_set_document_manager (GbDocumentMenuB
GbDocumentManager *document_manager);
void gb_document_menu_button_select_document (GbDocumentMenuButton *button,
GbDocument *document);
+void gb_document_menu_button_focus_search (GbDocumentMenuButton *button);
G_END_DECLS
diff --git a/src/documents/gb-document-stack.c b/src/documents/gb-document-stack.c
index b244cdf..d4e4e22 100644
--- a/src/documents/gb-document-stack.c
+++ b/src/documents/gb-document-stack.c
@@ -543,6 +543,18 @@ gb_document_stack_focus_right (GSimpleAction *action,
}
static void
+gb_document_stack_focus_search (GSimpleAction *action,
+ GVariant *parameter,
+ gpointer user_data)
+{
+ GbDocumentStack *stack = user_data;
+
+ g_return_if_fail (GB_IS_DOCUMENT_STACK (stack));
+
+ gb_document_menu_button_focus_search (stack->priv->document_button);
+}
+
+static void
gb_document_stack_finalize (GObject *object)
{
GbDocumentStackPrivate *priv = GB_DOCUMENT_STACK (object)->priv;
@@ -689,6 +701,7 @@ gb_document_stack_init (GbDocumentStack *self)
{ "split-document-right", gb_document_stack_split_document_right },
{ "focus-left", gb_document_stack_focus_left },
{ "focus-right", gb_document_stack_focus_right },
+ { "focus-search", gb_document_stack_focus_search },
{ "close", gb_document_stack_close },
};
GSimpleActionGroup *actions;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]