[gtk+/icon-view-refactor] Ensure that GtkIconView items get redrawn when the focus cell changes.



commit 3bc33066d7af2b92f4bea5d453e3a800965773f1
Author: Tristan Van Berkom <tristan van berkom gmail com>
Date:   Thu Jan 6 01:30:17 2011 +0900

    Ensure that GtkIconView items get redrawn when the focus cell changes.
    
    Seems the redraw was not happenning from keynav when set_focus_cell()
    was called because keynav already updates the focus-cell. Now we
    just unconditionally redraw the focus item when set_focus_cell() is
    called.

 gtk/gtkiconview.c |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/gtk/gtkiconview.c b/gtk/gtkiconview.c
index 4d5595b..1ab2330 100644
--- a/gtk/gtkiconview.c
+++ b/gtk/gtkiconview.c
@@ -3122,6 +3122,13 @@ gtk_icon_view_set_cursor_item (GtkIconView     *icon_view,
   AtkObject *item_obj;
   AtkObject *cursor_item_obj;
 
+  /* When hitting this path from keynav, the focus cell is
+   * already set, we dont need to notify the atk object
+   * but we still need to queue the draw here (in the case
+   * that the focus cell changes but not the cursor item).
+   */
+  gtk_icon_view_queue_draw_item (icon_view, item);
+
   if (icon_view->priv->cursor_item == item &&
       (cursor_cell == NULL || cursor_cell == gtk_cell_area_get_focus_cell (icon_view->priv->cell_area)))
     return;
@@ -3147,8 +3154,6 @@ gtk_icon_view_set_cursor_item (GtkIconView     *icon_view,
       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);
   
   /* Notify that accessible focus object has changed */
   item_obj = atk_object_ref_accessible_child (obj, item->index);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]