From 3962c1166f54cb2c9f83de43cb75f82963ee70ef Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Fri, 8 Apr 2005 12:53:09 +0000 Subject: [PATCH] Fix double-click to autosize treeview columns. This was probably broken 2005-04-08 Matthias Clasen 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. --- ChangeLog | 12 ++++++++++++ ChangeLog.pre-2-10 | 12 ++++++++++++ ChangeLog.pre-2-8 | 12 ++++++++++++ gtk/gtktreeview.c | 3 ++- 4 files changed, 38 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index c227fed36c..8622dff4b3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2005-04-08 Matthias Clasen + + 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 * gtk/gtkmenu.c (gtk_menu_paint): Allow setting background diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index c227fed36c..8622dff4b3 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,15 @@ +2005-04-08 Matthias Clasen + + 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 * gtk/gtkmenu.c (gtk_menu_paint): Allow setting background diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index c227fed36c..8622dff4b3 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,15 @@ +2005-04-08 Matthias Clasen + + 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 * gtk/gtkmenu.c (gtk_menu_paint): Allow setting background diff --git a/gtk/gtktreeview.c b/gtk/gtktreeview.c index b0ee48f1c8..865cf48433 100644 --- a/gtk/gtktreeview.c +++ b/gtk/gtktreeview.c @@ -2486,6 +2486,7 @@ gtk_tree_view_button_press (GtkWidget *widget, if (event->type == GDK_2BUTTON_PRESS && 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); return TRUE; } @@ -2500,7 +2501,6 @@ gtk_tree_view_button_press (GtkWidget *widget, gtk_grab_add (widget); GTK_TREE_VIEW_SET_FLAG (tree_view, GTK_TREE_VIEW_IN_COLUMN_RESIZE); column->resized_width = column->width; - column->use_resized_width = TRUE; /* block attached dnd signal handler */ drag_data = g_object_get_data (G_OBJECT (widget), "gtk-site-data"); @@ -3186,6 +3186,7 @@ gtk_tree_view_motion_resize_column (GtkWidget *widget, if (x != tree_view->priv->x_drag && (new_width != column->fixed_width)); { + column->use_resized_width = TRUE; column->resized_width = new_width; gtk_widget_queue_resize (widget); } -- GitLab