Re: TreeView column autoresize

Andrew E. Makeev wrote:
В Птн, 15/12/2006 в 18:35 +0100, David Nečas (Yeti) пишет:
On Fri, Dec 15, 2006 at 08:05:53PM +0300, Andrew E. Makeev wrote:
I am not sure if that line was removed from code for purpose or
If someone could look thru CVS history and find that out, it would be

Nice work, David. Thank you.

Changes for gtktreeview

Mon Nov 15 14:25:21 2004  Jonathan Blandford  <jrb redhat com>

        * gtk/gtktreeviewcolumn.c (_gtk_tree_view_column_cell_set_dirty):
        Patch from Gavin Romig-Koch <gavin redhat com> to no longer reset
        the resized_width when marking a column dirty.

Could we ask Gavin now, what was that patch for?
Probably, we could do work around to avoid missing that double-click
autoresize feature.
These are my notes from the time:

_gtk_tree_view_column_cell_set_dirty is often called repeatedly on the same
column, for instance by gtk_tree_view_column_set_attributesv which calls it
through gtk_tree_view_column_clear_attributes, and then again through
gtk_tree_view_column_add_attribute.  Because _set_dirty sets resized_width
to the max of requested_width and button_request, and also sets
requested_width to -1:

  tree_column->resized_width = MAX (tree_column->requested_width, tree_column->button_request);
  tree_column->requested_width = -1;

repeatedly calling _set_dirty will force resized_width to button_request.  This
can be seen in Nautilus by resizing the File Name column and then changing the
zoom level.

It does not make sense for _gtk_tree_view_column_cell_set_dirty to be changing
resized_width.  _set_dirty is used to tell the column cell that one or more
display related attributes of the cell have changed, and that the cell needs
to be re-rendered and re-displayed.  resized_width keeps track of the fact
that the user has resized a column directly with the mouse, and what size they
resized it to.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]