[gnome-builder] layout: add action to focus the document list
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] layout: add action to focus the document list
- Date: Wed, 19 Jul 2017 11:15:06 +0000 (UTC)
commit 714d5d1f93c72762469a78e26d4dda953caeca99
Author: Christian Hergert <chergert redhat com>
Date: Mon Jul 10 00:41:59 2017 -0700
layout: add action to focus the document list
libide/layout/ide-layout-private.h | 1 +
libide/layout/ide-layout-stack-actions.c | 16 ++++++++++++++++
libide/layout/ide-layout-stack-header.c | 9 +++++++++
3 files changed, 26 insertions(+), 0 deletions(-)
---
diff --git a/libide/layout/ide-layout-private.h b/libide/layout/ide-layout-private.h
index 173dd13..d731a6e 100644
--- a/libide/layout/ide-layout-private.h
+++ b/libide/layout/ide-layout-private.h
@@ -51,6 +51,7 @@ void _ide_layout_stack_request_close (IdeLayoutStack
IdeLayoutView *view);
void _ide_layout_stack_header_update (IdeLayoutStackHeader *self,
IdeLayoutView *view);
+void _ide_layout_stack_header_focus_list (IdeLayoutStackHeader *self);
void _ide_layout_stack_header_hide (IdeLayoutStackHeader *self);
void _ide_layout_stack_header_popdown (IdeLayoutStackHeader *self);
void _ide_layout_stack_header_set_views (IdeLayoutStackHeader *self,
diff --git a/libide/layout/ide-layout-stack-actions.c b/libide/layout/ide-layout-stack-actions.c
index 4eaf029..4ce887c 100644
--- a/libide/layout/ide-layout-stack-actions.c
+++ b/libide/layout/ide-layout-stack-actions.c
@@ -277,6 +277,21 @@ ide_layout_stack_actions_close_stack (GSimpleAction *action,
NULL);
}
+static void
+ide_layout_stack_actions_show_list (GSimpleAction *action,
+ GVariant *variant,
+ gpointer user_data)
+{
+ IdeLayoutStack *self = user_data;
+ IdeLayoutStackHeader *header;
+
+ g_assert (G_IS_SIMPLE_ACTION (action));
+ g_assert (IDE_IS_LAYOUT_STACK (self));
+
+ header = IDE_LAYOUT_STACK_HEADER (ide_layout_stack_get_titlebar (self));
+ _ide_layout_stack_header_focus_list (header);
+}
+
static const GActionEntry actions[] = {
{ "open-in-new-frame", ide_layout_stack_actions_open_in_new_frame },
{ "close-stack", ide_layout_stack_actions_close_stack },
@@ -286,6 +301,7 @@ static const GActionEntry actions[] = {
{ "move-right", ide_layout_stack_actions_move_right },
{ "move-left", ide_layout_stack_actions_move_left },
{ "split-view", ide_layout_stack_actions_split_view },
+ { "show-list", ide_layout_stack_actions_show_list },
};
void
diff --git a/libide/layout/ide-layout-stack-header.c b/libide/layout/ide-layout-stack-header.c
index bd86c90..4f4fd14 100644
--- a/libide/layout/ide-layout-stack-header.c
+++ b/libide/layout/ide-layout-stack-header.c
@@ -83,6 +83,15 @@ G_DEFINE_TYPE (IdeLayoutStackHeader, ide_layout_stack_header, DZL_TYPE_PRIORITY_
static GParamSpec *properties [N_PROPS];
void
+_ide_layout_stack_header_focus_list (IdeLayoutStackHeader *self)
+{
+ g_return_if_fail (IDE_IS_LAYOUT_STACK_HEADER (self));
+
+ gtk_popover_popup (self->title_popover);
+ gtk_widget_grab_focus (GTK_WIDGET (self->title_list_box));
+}
+
+void
_ide_layout_stack_header_hide (IdeLayoutStackHeader *self)
{
g_return_if_fail (IDE_IS_LAYOUT_STACK_HEADER (self));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]