Commit 3962c116 authored by Matthias Clasen's avatar Matthias Clasen Committed by Matthias Clasen

Fix double-click to autosize treeview columns. This was probably broken


2005-04-08  Matthias Clasen  <mclasen@redhat.com>

	Fix double-click to autosize treeview columns. This was
	probably broken since 2.2 ! (#169675)

	* gtk/gtktreeview.c (gtk_tree_view_button_press): Leave the
	"user-resized" state of the column on a double-click to
	autosize.
	(gtk_tree_view_button_press, gtk_tree_view_motion_resize_column):
	Enter the "user-resized" state of the column only if a drag
	actually changes the column width, not on any click.
parent cdf08146
2005-04-08 Matthias Clasen <mclasen@redhat.com>
Fix double-click to autosize treeview columns. This was
probably broken since 2.2 ! (#169675)
* gtk/gtktreeview.c (gtk_tree_view_button_press): Leave the
"user-resized" state of the column on a double-click to
autosize.
(gtk_tree_view_button_press, gtk_tree_view_motion_resize_column):
Enter the "user-resized" state of the column only if a drag
actually changes the column width, not on any click.
2005-04-07 Matthias Clasen <mclasen@redhat.com> 2005-04-07 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkmenu.c (gtk_menu_paint): Allow setting background * gtk/gtkmenu.c (gtk_menu_paint): Allow setting background
......
2005-04-08 Matthias Clasen <mclasen@redhat.com>
Fix double-click to autosize treeview columns. This was
probably broken since 2.2 ! (#169675)
* gtk/gtktreeview.c (gtk_tree_view_button_press): Leave the
"user-resized" state of the column on a double-click to
autosize.
(gtk_tree_view_button_press, gtk_tree_view_motion_resize_column):
Enter the "user-resized" state of the column only if a drag
actually changes the column width, not on any click.
2005-04-07 Matthias Clasen <mclasen@redhat.com> 2005-04-07 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkmenu.c (gtk_menu_paint): Allow setting background * gtk/gtkmenu.c (gtk_menu_paint): Allow setting background
......
2005-04-08 Matthias Clasen <mclasen@redhat.com>
Fix double-click to autosize treeview columns. This was
probably broken since 2.2 ! (#169675)
* gtk/gtktreeview.c (gtk_tree_view_button_press): Leave the
"user-resized" state of the column on a double-click to
autosize.
(gtk_tree_view_button_press, gtk_tree_view_motion_resize_column):
Enter the "user-resized" state of the column only if a drag
actually changes the column width, not on any click.
2005-04-07 Matthias Clasen <mclasen@redhat.com> 2005-04-07 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkmenu.c (gtk_menu_paint): Allow setting background * gtk/gtkmenu.c (gtk_menu_paint): Allow setting background
......
...@@ -2486,6 +2486,7 @@ gtk_tree_view_button_press (GtkWidget *widget, ...@@ -2486,6 +2486,7 @@ gtk_tree_view_button_press (GtkWidget *widget,
if (event->type == GDK_2BUTTON_PRESS && if (event->type == GDK_2BUTTON_PRESS &&
gtk_tree_view_column_get_sizing (column) != GTK_TREE_VIEW_COLUMN_AUTOSIZE) gtk_tree_view_column_get_sizing (column) != GTK_TREE_VIEW_COLUMN_AUTOSIZE)
{ {
column->use_resized_width = FALSE;
_gtk_tree_view_column_autosize (tree_view, column); _gtk_tree_view_column_autosize (tree_view, column);
return TRUE; return TRUE;
} }
...@@ -2500,7 +2501,6 @@ gtk_tree_view_button_press (GtkWidget *widget, ...@@ -2500,7 +2501,6 @@ gtk_tree_view_button_press (GtkWidget *widget,
gtk_grab_add (widget); gtk_grab_add (widget);
GTK_TREE_VIEW_SET_FLAG (tree_view, GTK_TREE_VIEW_IN_COLUMN_RESIZE); GTK_TREE_VIEW_SET_FLAG (tree_view, GTK_TREE_VIEW_IN_COLUMN_RESIZE);
column->resized_width = column->width; column->resized_width = column->width;
column->use_resized_width = TRUE;
/* block attached dnd signal handler */ /* block attached dnd signal handler */
drag_data = g_object_get_data (G_OBJECT (widget), "gtk-site-data"); drag_data = g_object_get_data (G_OBJECT (widget), "gtk-site-data");
...@@ -3186,6 +3186,7 @@ gtk_tree_view_motion_resize_column (GtkWidget *widget, ...@@ -3186,6 +3186,7 @@ gtk_tree_view_motion_resize_column (GtkWidget *widget,
if (x != tree_view->priv->x_drag && if (x != tree_view->priv->x_drag &&
(new_width != column->fixed_width)); (new_width != column->fixed_width));
{ {
column->use_resized_width = TRUE;
column->resized_width = new_width; column->resized_width = new_width;
gtk_widget_queue_resize (widget); gtk_widget_queue_resize (widget);
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment