summaryrefslogtreecommitdiff
path: root/gtk/gtktreeview.c
diff options
context:
space:
mode:
authorTristan Van Berkom <tristan.van.berkom@gmail.com>2010-12-10 16:22:06 +0900
committerKristian Rietveld <kris@gtk.org>2010-12-12 17:21:28 +0100
commit2e1e97305f9a917315a22b103d3b5374aefaeaae (patch)
treee06339ad29a88c20e013571976bcdedb7ff28e7d /gtk/gtktreeview.c
parent31226ebfb220a9b0419c1cc98b5238ec203c8a9e (diff)
downloadgtk+-2e1e97305f9a917315a22b103d3b5374aefaeaae.tar.gz
Make GtkTreeView explicitly focus the first cell in the first column when grabbing focus
When focus is initially grabbed and there is no focus column, when selecting the first column for focus, further explicitly focus into the first cell using gtk_cell_area_focus().
Diffstat (limited to 'gtk/gtktreeview.c')
-rw-r--r--gtk/gtktreeview.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/gtk/gtktreeview.c b/gtk/gtktreeview.c
index 95550fe143..0eedbad9d2 100644
--- a/gtk/gtktreeview.c
+++ b/gtk/gtktreeview.c
@@ -10081,7 +10081,16 @@ gtk_tree_view_focus_to_cursor (GtkTreeView *tree_view)
{
if (gtk_tree_view_column_get_visible (GTK_TREE_VIEW_COLUMN (list->data)))
{
+ GtkCellArea *cell_area;
+
tree_view->priv->focus_column = GTK_TREE_VIEW_COLUMN (list->data);
+
+ /* This happens when the treeview initially grabs focus and there
+ * is no column in focus, here we explicitly focus into the first cell */
+ cell_area = gtk_cell_layout_get_area (GTK_CELL_LAYOUT (tree_view->priv->focus_column));
+ if (!gtk_cell_area_get_focus_cell (cell_area))
+ gtk_cell_area_focus (cell_area, GTK_DIR_RIGHT);
+
break;
}
}