summaryrefslogtreecommitdiff
path: root/gtk/gtkiconview.c
diff options
context:
space:
mode:
authorTristan Van Berkom <tristan.van.berkom@gmail.com>2011-01-05 21:58:32 +0900
committerTristan Van Berkom <tristan.van.berkom@gmail.com>2011-01-06 13:51:49 +0900
commitbab0f5a5c1669c8324609efbaaeccc066445d808 (patch)
tree7d1feb7d4ffd58af14a83c13852134f16f0f3cbe /gtk/gtkiconview.c
parentb7c25c41d6d0abd548bbcd61e1a5b4266235a7b8 (diff)
downloadgtk+-bab0f5a5c1669c8324609efbaaeccc066445d808.tar.gz
Fixed GtkIconView keynav
Icon View was not initially setting focus on a cell when focus initially comes into the view. Focusing into whatever is the first cell in the cursor item when set_cursor_item is called with a NULL cell fixes this.
Diffstat (limited to 'gtk/gtkiconview.c')
-rw-r--r--gtk/gtkiconview.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/gtk/gtkiconview.c b/gtk/gtkiconview.c
index 1d03c03b81..de5889ec78 100644
--- a/gtk/gtkiconview.c
+++ b/gtk/gtkiconview.c
@@ -3100,7 +3100,14 @@ gtk_icon_view_set_cursor_item (GtkIconView *icon_view,
}
icon_view->priv->cursor_item = item;
- gtk_cell_area_set_focus_cell (icon_view->priv->cell_area, cursor_cell);
+ if (cursor_cell)
+ gtk_cell_area_set_focus_cell (icon_view->priv->cell_area, cursor_cell);
+ else
+ {
+ /* Make sure there is a cell in focus initially */
+ if (!gtk_cell_area_get_focus_cell (icon_view->priv->cell_area))
+ gtk_cell_area_focus (icon_view->priv->cell_area, GTK_DIR_TAB_FORWARD);
+ }
gtk_icon_view_queue_draw_item (icon_view, item);
@@ -3734,6 +3741,7 @@ gtk_icon_view_move_cursor_up_down (GtkIconView *icon_view,
direction == GTK_DIR_UP ?
GTK_DIR_TAB_BACKWARD :
GTK_DIR_TAB_FORWARD);
+
}
gtk_cell_area_set_focus_cell (icon_view->priv->cell_area, cell);
@@ -3878,6 +3886,7 @@ gtk_icon_view_move_cursor_left_right (GtkIconView *icon_view,
direction == GTK_DIR_LEFT ?
GTK_DIR_TAB_BACKWARD :
GTK_DIR_TAB_FORWARD);
+
}
gtk_cell_area_set_focus_cell (icon_view->priv->cell_area, cell);