[gnome-builder] grid: pass focus to first stack
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] grid: pass focus to first stack
- Date: Wed, 17 Dec 2014 10:47:32 +0000 (UTC)
commit 6ff59aed019f79f2ed97534a01794a993f59d890
Author: Christian Hergert <christian hergert me>
Date: Mon Dec 15 15:55:35 2014 -0800
grid: pass focus to first stack
We might want to do focus tracking here and return it to the last
focused stack.
src/documents/gb-document-grid.c | 17 +++++++++++++++++
1 files changed, 17 insertions(+), 0 deletions(-)
---
diff --git a/src/documents/gb-document-grid.c b/src/documents/gb-document-grid.c
index 4f5edd0..ba8465b 100644
--- a/src/documents/gb-document-grid.c
+++ b/src/documents/gb-document-grid.c
@@ -611,6 +611,20 @@ cleanup:
}
static void
+gb_document_grid_grab_focus (GtkWidget *widget)
+{
+ GbDocumentGrid *grid = (GbDocumentGrid *)widget;
+ GList *stacks;
+
+ g_return_if_fail (GB_IS_DOCUMENT_GRID (grid));
+
+ stacks = gb_document_grid_get_stacks (grid);
+ if (stacks)
+ gtk_widget_grab_focus (stacks->data);
+ g_list_free (stacks);
+}
+
+static void
gb_document_grid_get_property (GObject *object,
guint prop_id,
GValue *value,
@@ -662,11 +676,14 @@ static void
gb_document_grid_class_init (GbDocumentGridClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
+ GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
object_class->finalize = gb_document_grid_finalize;
object_class->get_property = gb_document_grid_get_property;
object_class->set_property = gb_document_grid_set_property;
+ widget_class->grab_focus = gb_document_grid_grab_focus;
+
/**
* GbDocumentGrid:document-manager:
*
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]