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 148144 - Allow custom layout of renderers in gtkiconview
Allow custom layout of renderers in gtkiconview
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: GtkIconView
2.6.x
Other Linux
: Normal enhancement
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks: 160242 162903 163608 300996 301022
 
 
Reported: 2004-07-22 04:08 UTC by Daniel Brodie
Modified: 2011-02-04 16:18 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
first patch (102.39 KB, patch)
2005-01-27 19:28 UTC, Matthias Clasen
none Details | Review
hopefully better (102.46 KB, patch)
2005-02-08 20:12 UTC, Matthias Clasen
none Details | Review

Description Daniel Brodie 2004-07-22 04:08:44 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.
Comment 1 Matthias Clasen 2005-01-27 19:28:50 UTC
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
Comment 2 Christian Neumair 2005-02-08 19:44:13 UTC
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.
Comment 3 Matthias Clasen 2005-02-08 20:12:51 UTC
Created attachment 37198 [details] [review]
hopefully better
Comment 4 Matthias Clasen 2005-05-02 20:37:13 UTC
I have committed an updated version of my patch now.