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 147867 - fix the size allocation logic in GtkTreeView / GtkTreeViewColumn
fix the size allocation logic in GtkTreeView / GtkTreeViewColumn
Status: RESOLVED OBSOLETE
Product: gtk+
Classification: Platform
Component: Widget: GtkTreeView
2.5.x
Other Linux
: Normal normal
: Medium fix
Assigned To: gtktreeview-bugs
gtktreeview-bugs
Depends on:
Blocks:
 
 
Reported: 2004-07-19 04:31 UTC by Matthias Clasen
Modified: 2013-10-16 02:07 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
cell geometry (25.96 KB, image/png)
2004-07-19 04:31 UTC, Matthias Clasen
Details

Description Matthias Clasen 2004-07-19 04:31:12 UTC
Things are quite broken currently, e.g. the cell_area is not necessarily
contained within the background_area, and if you set horizontal-separator to
larger values, cell get moved out of the column. Also the editable widgets are
not placed exactly over the cells they are editing.

Also, jrb reports that the cell_areas are wrong for all shrunk cells.

We have come up with a scheme for how things should be done, see the attached
image. After fixing the size allocation to conform to it, the image should be
moved into docs and be referred to from widget-geometry.txt (unless someone
wants to go to the trouble of converting it to ASCII art)
Comment 1 Matthias Clasen 2004-07-19 04:31:45 UTC
Created attachment 29638 [details]
cell geometry
Comment 2 Jonathan Blandford 2004-08-31 21:36:02 UTC
I committed a partial fix for this, and added that excellent picture to
docs/tree-column-sizing.png.

To really fix this bug, I think we're going to have to do a minor audit of
gtktreeview{,column}.c.  In particular:

 * check all the (indirect) callers of gtk_tree_view_column_cell_process_action,
and make sure that they all pass in a consistent cell_area/background area

 * Have the background area be essentially cell_area + vertical-separator, and
have already subtracted out things like the expander and the
horizontal-separator.  It makes the background area a little bit useless, but
that's okay -- it was always dubious.

 * Double check the image.  In particular, I think that we aren't calculating
extra_space correctly.
Comment 3 Billy Biggs 2004-10-15 13:42:48 UTC
We have a problem that I think is related.  If a column of text is right aligned
and the column size is reduced, text starts getting clipped on all columns as
soon as the longest string won't fit, rather than having every cell right align
to the visible area.

jrb, is this what you meant when you said that the cell_areas are wrong for all
shrunk cells?  What's happening is that the cell width given to cell renderers
in GTK+ is the maximum size over all rows in that column.  This means that the x
offset will be calculated assuming an edge which is not visible.  I think it
would make more sense if cell_area represented the visible area.

Also see:

  https://bugs.eclipse.org/bugs/show_bug.cgi?id=76062
Comment 4 Kristian Rietveld 2005-07-13 12:03:03 UTC
Right now, cell_area is the actual cell_area plus the focus_line_width, which is
different from the cell geometry image, but (I think) the same as Jonathan was
saying in his comment. background_area is basically cell_area plus separator
(horizontal and vertical).
Comment 5 Federico Mena Quintero 2005-09-29 00:34:26 UTC
See gtk+/tests/testcellrenderertext - it may be useful to test this kind of stuff.
Comment 6 Kristian Rietveld 2006-05-28 13:29:55 UTC
I did some more fixage in this area last week.

I don't think we can change the background_area behaviour at this point.  The image is pretty much right as far I'm concerned.  A little audit of _cell_process_action() might be in place, but I think I looked at most cases already while debugging last week (and a few months back).
Comment 7 Timothy Arceri 2013-10-15 06:28:50 UTC
I assume this is probably fixed by now? Can someone confirm if this bug can be closed?
Comment 8 Matthias Clasen 2013-10-16 02:07:12 UTC
if it is not fixed, everybody has gotten used to the remaining issues now...