GNOME Bugzilla – Bug 678418
Lacks a way to get the position of an item in the icon view
Last modified: 2012-06-25 15:11:09 UTC
There is no function call that mirrors gtk_tree_view_get_cell_area() for the icon view. I need this for boxes in order to start an animation to/from the (de)activated item.
Created attachment 216762 [details] [review] Add gtk_icon_view_get_cell_area This gets the current cell area of a particular item. Its similar to gtk_tree_view_get_cell_area(). The code is extracted from gtk_icon_view_set_tooltip_cell which now just calls the old code.
Review of attachment 216762 [details] [review]: Given that we have identical API in GtkTreeView, and already have this code internally anyway, I don't see a reason not to accept this. ::: gtk/gtkiconview.c @@ +4459,3 @@ + * + * Fills the bounding rectangle in widget coordinates for the cell specified by + * @path and @cell. If @cell is %NULL the main cell area is used. It would be clearer to say 'area of the entire item' instead of 'main cell area'. @@ +4565,3 @@ + if (!gtk_icon_view_get_cell_area (icon_view, + path, + cell, &rect)) This could go in a single line, I think.
The following fix has been pushed: fb91fa2 Add gtk_icon_view_get_cell_area
Created attachment 217039 [details] [review] Add gtk_icon_view_get_cell_area This gets the current cell area of a particular item. Its similar to gtk_tree_view_get_cell_area(). The code is extracted from gtk_icon_view_set_tooltip_cell which now just calls the old code.
GtkIconView actually has a property called cell_area, which sort of conflicts with this method. We should probably rename it to avoid the conflict. What about gtk_icon_view_get_cell_rect?
Renamed to get_cell_rect