[gtk+] Fixed GtkIconView keynav
- From: Tristan Van Berkom <tvb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] Fixed GtkIconView keynav
- Date: Thu, 6 Jan 2011 04:46:05 +0000 (UTC)
commit bab0f5a5c1669c8324609efbaaeccc066445d808
Author: Tristan Van Berkom <tristan van berkom gmail com>
Date: Wed Jan 5 21:58:32 2011 +0900
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.
gtk/gtkiconview.c | 11 ++++++++++-
1 files changed, 10 insertions(+), 1 deletions(-)
---
diff --git a/gtk/gtkiconview.c b/gtk/gtkiconview.c
index 1d03c03..de5889e 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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]