From 6bc31ea4d9bd8250d26af5a0e2fac78b1fe9520a Mon Sep 17 00:00:00 2001 From: Jonathan Blandford Date: Fri, 18 Jan 2002 00:23:26 +0000 Subject: [PATCH] For some reason, I was activating a row while just selecting it. Reported Thu Jan 17 16:34:55 2002 Jonathan Blandford * gtk/gtktreeview.c (gtk_tree_view_real_select_cursor_row): For some reason, I was activating a row while just selecting it. Reported by andersca. (gtk_tree_view_size_request): add a validate_rows_handler to give us a rough width of the widget. * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_update_button): Queue a resize here just in case. It's needed in over half the cases, and I don't want to do a diff to figure out exactly when it's needed. --- ChangeLog | 13 +++++++++++++ ChangeLog.pre-2-0 | 13 +++++++++++++ ChangeLog.pre-2-10 | 13 +++++++++++++ ChangeLog.pre-2-2 | 13 +++++++++++++ ChangeLog.pre-2-4 | 13 +++++++++++++ ChangeLog.pre-2-6 | 13 +++++++++++++ ChangeLog.pre-2-8 | 13 +++++++++++++ gtk/gtktreeview.c | 16 +++++++++++----- gtk/gtktreeviewcolumn.c | 6 ++++++ 9 files changed, 108 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 26eddf2ce2..5182431543 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +Thu Jan 17 16:34:55 2002 Jonathan Blandford + + * gtk/gtktreeview.c (gtk_tree_view_real_select_cursor_row): For + some reason, I was activating a row while just selecting it. + Reported by andersca. + (gtk_tree_view_size_request): add a + validate_rows_handler to give us a rough width of the widget. + + * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_update_button): + Queue a resize here just in case. It's needed in over half the + cases, and I don't want to do a diff to figure out exactly when + it's needed. + 2002-01-17 Matthias Clasen * gtk/gtkinputdialog.c, diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0 index 26eddf2ce2..5182431543 100644 --- a/ChangeLog.pre-2-0 +++ b/ChangeLog.pre-2-0 @@ -1,3 +1,16 @@ +Thu Jan 17 16:34:55 2002 Jonathan Blandford + + * gtk/gtktreeview.c (gtk_tree_view_real_select_cursor_row): For + some reason, I was activating a row while just selecting it. + Reported by andersca. + (gtk_tree_view_size_request): add a + validate_rows_handler to give us a rough width of the widget. + + * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_update_button): + Queue a resize here just in case. It's needed in over half the + cases, and I don't want to do a diff to figure out exactly when + it's needed. + 2002-01-17 Matthias Clasen * gtk/gtkinputdialog.c, diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 26eddf2ce2..5182431543 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,16 @@ +Thu Jan 17 16:34:55 2002 Jonathan Blandford + + * gtk/gtktreeview.c (gtk_tree_view_real_select_cursor_row): For + some reason, I was activating a row while just selecting it. + Reported by andersca. + (gtk_tree_view_size_request): add a + validate_rows_handler to give us a rough width of the widget. + + * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_update_button): + Queue a resize here just in case. It's needed in over half the + cases, and I don't want to do a diff to figure out exactly when + it's needed. + 2002-01-17 Matthias Clasen * gtk/gtkinputdialog.c, diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index 26eddf2ce2..5182431543 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,16 @@ +Thu Jan 17 16:34:55 2002 Jonathan Blandford + + * gtk/gtktreeview.c (gtk_tree_view_real_select_cursor_row): For + some reason, I was activating a row while just selecting it. + Reported by andersca. + (gtk_tree_view_size_request): add a + validate_rows_handler to give us a rough width of the widget. + + * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_update_button): + Queue a resize here just in case. It's needed in over half the + cases, and I don't want to do a diff to figure out exactly when + it's needed. + 2002-01-17 Matthias Clasen * gtk/gtkinputdialog.c, diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index 26eddf2ce2..5182431543 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,16 @@ +Thu Jan 17 16:34:55 2002 Jonathan Blandford + + * gtk/gtktreeview.c (gtk_tree_view_real_select_cursor_row): For + some reason, I was activating a row while just selecting it. + Reported by andersca. + (gtk_tree_view_size_request): add a + validate_rows_handler to give us a rough width of the widget. + + * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_update_button): + Queue a resize here just in case. It's needed in over half the + cases, and I don't want to do a diff to figure out exactly when + it's needed. + 2002-01-17 Matthias Clasen * gtk/gtkinputdialog.c, diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 26eddf2ce2..5182431543 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,16 @@ +Thu Jan 17 16:34:55 2002 Jonathan Blandford + + * gtk/gtktreeview.c (gtk_tree_view_real_select_cursor_row): For + some reason, I was activating a row while just selecting it. + Reported by andersca. + (gtk_tree_view_size_request): add a + validate_rows_handler to give us a rough width of the widget. + + * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_update_button): + Queue a resize here just in case. It's needed in over half the + cases, and I don't want to do a diff to figure out exactly when + it's needed. + 2002-01-17 Matthias Clasen * gtk/gtkinputdialog.c, diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 26eddf2ce2..5182431543 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,16 @@ +Thu Jan 17 16:34:55 2002 Jonathan Blandford + + * gtk/gtktreeview.c (gtk_tree_view_real_select_cursor_row): For + some reason, I was activating a row while just selecting it. + Reported by andersca. + (gtk_tree_view_size_request): add a + validate_rows_handler to give us a rough width of the widget. + + * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_update_button): + Queue a resize here just in case. It's needed in over half the + cases, and I don't want to do a diff to figure out exactly when + it's needed. + 2002-01-17 Matthias Clasen * gtk/gtkinputdialog.c, diff --git a/gtk/gtktreeview.c b/gtk/gtktreeview.c index 3cbba62aca..eff44c82a7 100644 --- a/gtk/gtktreeview.c +++ b/gtk/gtktreeview.c @@ -1448,6 +1448,9 @@ gtk_tree_view_size_request (GtkWidget *widget, tree_view = GTK_TREE_VIEW (widget); + /* we validate 50 rows initially just to make sure we have some size */ + /* in practice, with a lot of static lists, this should get a good width */ + validate_rows_handler (tree_view); gtk_tree_view_size_request_columns (tree_view); gtk_tree_view_update_size (GTK_TREE_VIEW (widget)); @@ -2348,17 +2351,21 @@ gtk_tree_view_motion_resize_column (GtkWidget *widget, gint x; gint new_width; GtkTreeViewColumn *column; + GtkTreeView *tree_view = GTK_TREE_VIEW (widget); - column = gtk_tree_view_get_column (GTK_TREE_VIEW (widget), GTK_TREE_VIEW (widget)->priv->drag_pos); + column = gtk_tree_view_get_column (tree_view, tree_view->priv->drag_pos); if (event->is_hint || event->window != widget->window) gtk_widget_get_pointer (widget, &x, NULL); else x = event->x; - new_width = gtk_tree_view_new_column_width (GTK_TREE_VIEW (widget), - GTK_TREE_VIEW (widget)->priv->drag_pos, &x); - if (x != GTK_TREE_VIEW (widget)->priv->x_drag && + if (tree_view->priv->hadjustment) + x += tree_view->priv->hadjustment->value; + + new_width = gtk_tree_view_new_column_width (tree_view, + tree_view->priv->drag_pos, &x); + if (x != tree_view->priv->x_drag && (new_width != column->fixed_width)); { column->resized_width = new_width; @@ -6278,7 +6285,6 @@ gtk_tree_view_real_select_cursor_row (GtkTreeView *tree_view, gtk_widget_grab_focus (GTK_WIDGET (tree_view)); _gtk_tree_view_queue_draw_node (tree_view, cursor_tree, cursor_node, NULL); - gtk_tree_view_row_activated (tree_view, cursor_path, tree_view->priv->focus_column); gtk_tree_path_free (cursor_path); } diff --git a/gtk/gtktreeviewcolumn.c b/gtk/gtktreeviewcolumn.c index d441e1c07a..870c16ae74 100644 --- a/gtk/gtktreeviewcolumn.c +++ b/gtk/gtktreeviewcolumn.c @@ -723,6 +723,12 @@ gtk_tree_view_column_update_button (GtkTreeViewColumn *tree_column) } } } + /* Queue a resize on the assumption that we always want to catch all changes + * and columns don't change all that often. + */ + if (GTK_WIDGET_REALIZED (tree_column->tree_view)) + gtk_widget_queue_resize (tree_column->tree_view); + } /* Button signal handlers