[gtk+/cellarea-style-transitions: 8/9] iconview: Use GtkCellArea animation APIs



commit 9bc7839b1a07260c962ff13022f811aadd067ff9
Author: Carlos Garnacho <carlosg gnome org>
Date:   Wed May 11 13:45:09 2011 +0200

    iconview: Use GtkCellArea animation APIs
    
    This enables transition animations for cell renderers in iconviews

 gtk/gtkiconview.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)
---
diff --git a/gtk/gtkiconview.c b/gtk/gtkiconview.c
index b395f43..e081b09 100644
--- a/gtk/gtkiconview.c
+++ b/gtk/gtkiconview.c
@@ -2962,11 +2962,14 @@ gtk_icon_view_paint_item (GtkIconView     *icon_view,
   cell_area.width  = item->cell_area.width;
   cell_area.height = item->cell_area.height;
 
+  gtk_cell_area_set_animation_id (priv->cell_area, item);
+
   context = g_ptr_array_index (priv->row_contexts, item->row);
   gtk_cell_area_render (priv->cell_area, context,
                         widget, cr, &cell_area, &cell_area, flags,
                         draw_focus);
 
+  gtk_cell_area_set_animation_id (priv->cell_area, NULL);
   gtk_style_context_restore (style_context);
 }
 
@@ -3355,7 +3358,11 @@ gtk_icon_view_row_deleted (GtkTreeModel *model,
   item = list->data;
 
   if (icon_view->priv->cell_area)
-    gtk_cell_area_stop_editing (icon_view->priv->cell_area, TRUE);
+    {
+      gtk_cell_area_stop_editing (icon_view->priv->cell_area, TRUE);
+      gtk_cell_area_forget_animation_id (icon_view->priv->cell_area,
+                                         GTK_WIDGET (data), item);
+    }
 
   if (item == icon_view->priv->anchor_item)
     icon_view->priv->anchor_item = NULL;



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