GNOME Bugzilla – Bug 148144
Allow custom layout of renderers in gtkiconview
Last modified: 2011-02-04 16:18:41 UTC
GtkIconView currently does not allow custom ways to layout the cell renderers, I think it would be beneficiary to allow a table-like way to lay them out. Probably an interface simmilar to the GtkTreeViewColumn but that durin insertion you specify the [begin|end]_[row|column]. Uses can include something like the emblems tab in the file property dialog. Aloowing someone to add a toggle render would mean a much more consitant interface. Another use could be in an icon view for the epiphany download manager, so that there could be a progress rendereras well.
Created attachment 36609 [details] [review] first patch Here is a first patch, which does most things, including editing and activation. There are still some loose ends: - the supported layouts are a bit limited currently: * in vertical layout, we force the alignment of cells between items in a row, while we just ignore inter-item alignment in horizontal layout. * the "expand" flag is ignored * editables are always allocated to the full cell area, which can look a bit funny when you have a single-line text next to a big icon. NautilusIconContainer does this nicer, but doing the same thing would need special-casing * there are some places where we have to special-case depending on the type of cell renderer, e.g. for the background drawing behind the text renderers - keynav needs to be sorted out - a11y support is #if 0 ed out - when resizing in RTL mode while editing a cell, the editable widget is not repositioned properly
After applying this patch, GTK+ doesn't compile for me: - get_item_at_pos is undeclared warnings - implicit declaration of function `gtk_icon_view_unselect_all_internal' - gtk_icon_view_calculate_item_size: unused variable `wrap_width' The latter two are trivial, but I couldn't resolve the get_item_at_pos issue, since the call causing the undefined reference passes an additional parameter of type GtkIconViewCellInfo ** that is later uses.
Created attachment 37198 [details] [review] hopefully better
I have committed an updated version of my patch now.