]> Pileus Git - ~andy/gtk/commit
Use fixed width for resizing
authorJohn Lindgren <john.lindgren@aol.com>
Tue, 18 Dec 2012 06:26:37 +0000 (01:26 -0500)
committerBenjamin Otte <otte@redhat.com>
Tue, 15 Jan 2013 13:40:40 +0000 (14:40 +0100)
commit16195adc92e74b0c9c93475fec7e1fd2c1a585e2
tree4ccec4f74fad75ab76715e84149b5c567f8a1058
parentd0e0e489423e424075e7db400a079f533c656c4d
Use fixed width for resizing

Removes the hidden “resized-width” and “use-resized-width” properties
from GtkTreeViewColumn and instead uses the “fixed-width” property to
serve the same purpose.  “fixed-width”, if set, will now override the
auto-sized width (-1 is now a legal value meaning “not set”).

Additional “cleanups” in this commit:

1. When the user resizes the column the “expand” property is now also
set to FALSE, in order to prevent the column from suddenly jumping to a
different width when the window is resized.

2. The code that translated mouse movement to column sizes has been
simplified:
the change in column width is now calculated directly from the distance
the mouse cursor has traveled.  Weird behavior that might have happened
previously if the position of the column changed during resizing, is now
prevented.

3. There was some lengthy logic handling the keyboard shortcuts used to
resize treeview columns, which would call gtk_widget_error_bell() once
the minimum or maximum width was reached.  Instead of rewriting these
checks I simply set the “fixed-width” property to what was requested,
relying on the fact that it is already clamped between the minimum and
maximum width during size allocation.
I will greatly surprised if anyone notices the missing error bell.

https://bugzilla.gnome.org/show_bug.cgi?id=691751
gtk/gtktreeprivate.h
gtk/gtktreeview.c
gtk/gtktreeviewcolumn.c