After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 678418 - Lacks a way to get the position of an item in the icon view
Lacks a way to get the position of an item in the icon view
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: Other
3.5.x
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks: 678456
 
 
Reported: 2012-06-19 17:02 UTC by Alexander Larsson
Modified: 2012-06-25 15:11 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Add gtk_icon_view_get_cell_area (5.13 KB, patch)
2012-06-19 17:02 UTC, Alexander Larsson
accepted-commit_now Details | Review
Add gtk_icon_view_get_cell_area (6.12 KB, patch)
2012-06-22 17:53 UTC, Matthias Clasen
committed Details | Review

Description Alexander Larsson 2012-06-19 17:02:14 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.
Comment 1 Alexander Larsson 2012-06-19 17:02:46 UTC
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.
Comment 2 Matthias Clasen 2012-06-21 10:40:28 UTC
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.
Comment 3 Matthias Clasen 2012-06-22 17:53:01 UTC
The following fix has been pushed:
fb91fa2 Add gtk_icon_view_get_cell_area
Comment 4 Matthias Clasen 2012-06-22 17:53:05 UTC
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.
Comment 5 Alexander Larsson 2012-06-25 09:02:48 UTC
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?
Comment 6 Alexander Larsson 2012-06-25 15:11:09 UTC
Renamed to get_cell_rect