From ce46c83ab88c932aa2e42089f0afaeb8bb60b3f1 Mon Sep 17 00:00:00 2001 From: Jonathan Blandford Date: Tue, 21 Aug 2001 06:59:55 +0000 Subject: [PATCH] Tue Aug 21 02:57:13 2001 Jonathan Blandford > * gtk/gtktreeview.c (gtk_tree_view_button_press): Fix up selection a little. More needs to be done tomorrow. --- ChangeLog | 5 +++++ ChangeLog.pre-2-0 | 5 +++++ ChangeLog.pre-2-10 | 5 +++++ ChangeLog.pre-2-2 | 5 +++++ ChangeLog.pre-2-4 | 5 +++++ ChangeLog.pre-2-6 | 5 +++++ ChangeLog.pre-2-8 | 5 +++++ gtk/gtktreeview.c | 17 +++++++++++++++-- tests/testtreesort.c | 2 ++ 9 files changed, 52 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index de7b83d603..4302f8a0f9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Tue Aug 21 02:57:13 2001 Jonathan Blandford > + + * gtk/gtktreeview.c (gtk_tree_view_button_press): Fix up selection + a little. More needs to be done tomorrow. + Tue Aug 21 00:45:55 2001 Jonathan Blandford * gtk/gtktreeview.c (gtk_tree_view_destroy): Grr... Get it right. diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0 index de7b83d603..4302f8a0f9 100644 --- a/ChangeLog.pre-2-0 +++ b/ChangeLog.pre-2-0 @@ -1,3 +1,8 @@ +Tue Aug 21 02:57:13 2001 Jonathan Blandford > + + * gtk/gtktreeview.c (gtk_tree_view_button_press): Fix up selection + a little. More needs to be done tomorrow. + Tue Aug 21 00:45:55 2001 Jonathan Blandford * gtk/gtktreeview.c (gtk_tree_view_destroy): Grr... Get it right. diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index de7b83d603..4302f8a0f9 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,8 @@ +Tue Aug 21 02:57:13 2001 Jonathan Blandford > + + * gtk/gtktreeview.c (gtk_tree_view_button_press): Fix up selection + a little. More needs to be done tomorrow. + Tue Aug 21 00:45:55 2001 Jonathan Blandford * gtk/gtktreeview.c (gtk_tree_view_destroy): Grr... Get it right. diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index de7b83d603..4302f8a0f9 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,8 @@ +Tue Aug 21 02:57:13 2001 Jonathan Blandford > + + * gtk/gtktreeview.c (gtk_tree_view_button_press): Fix up selection + a little. More needs to be done tomorrow. + Tue Aug 21 00:45:55 2001 Jonathan Blandford * gtk/gtktreeview.c (gtk_tree_view_destroy): Grr... Get it right. diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index de7b83d603..4302f8a0f9 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,8 @@ +Tue Aug 21 02:57:13 2001 Jonathan Blandford > + + * gtk/gtktreeview.c (gtk_tree_view_button_press): Fix up selection + a little. More needs to be done tomorrow. + Tue Aug 21 00:45:55 2001 Jonathan Blandford * gtk/gtktreeview.c (gtk_tree_view_destroy): Grr... Get it right. diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index de7b83d603..4302f8a0f9 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,8 @@ +Tue Aug 21 02:57:13 2001 Jonathan Blandford > + + * gtk/gtktreeview.c (gtk_tree_view_button_press): Fix up selection + a little. More needs to be done tomorrow. + Tue Aug 21 00:45:55 2001 Jonathan Blandford * gtk/gtktreeview.c (gtk_tree_view_destroy): Grr... Get it right. diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index de7b83d603..4302f8a0f9 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,8 @@ +Tue Aug 21 02:57:13 2001 Jonathan Blandford > + + * gtk/gtktreeview.c (gtk_tree_view_button_press): Fix up selection + a little. More needs to be done tomorrow. + Tue Aug 21 00:45:55 2001 Jonathan Blandford * gtk/gtktreeview.c (gtk_tree_view_destroy): Grr... Get it right. diff --git a/gtk/gtktreeview.c b/gtk/gtktreeview.c index 92ff76408a..aa2f1debd7 100644 --- a/gtk/gtktreeview.c +++ b/gtk/gtktreeview.c @@ -1657,7 +1657,20 @@ gtk_tree_view_button_press (GtkWidget *widget, tree_view->priv->press_start_y = event->y; } - gtk_tree_view_real_set_cursor (tree_view, path, TRUE); + if (tree_view->priv->in_free_motion) + { + gtk_tree_view_real_set_cursor (tree_view, path, FALSE); + gtk_tree_view_real_toggle_cursor_row (tree_view); + } + else if (tree_view->priv->in_extended_selection) + { + gtk_tree_view_real_set_cursor (tree_view, path, FALSE); + gtk_tree_view_real_select_cursor_row (tree_view); + } + else + { + gtk_tree_view_real_set_cursor (tree_view, path, TRUE); + } if (event->button == 1 && event->type == GDK_2BUTTON_PRESS) { @@ -1670,8 +1683,8 @@ gtk_tree_view_button_press (GtkWidget *widget, gtk_tree_view_real_collapse_row (GTK_TREE_VIEW (widget), path, tree, node); } - gtk_tree_view_row_activated (tree_view, path, column); + gtk_tree_view_row_activated (tree_view, path, column); } gtk_tree_path_free (path); return TRUE; diff --git a/tests/testtreesort.c b/tests/testtreesort.c index 41e9decc76..a6c7d14fbe 100644 --- a/tests/testtreesort.c +++ b/tests/testtreesort.c @@ -69,6 +69,8 @@ main (int argc, char *argv[]) // gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (model), 0, GTK_TREE_SORT_ASCENDING); g_print ("start model\n"); tree_view = gtk_tree_view_new_with_model (model); + gtk_tree_selection_set_mode (gtk_tree_view_get_selection (GTK_TREE_VIEW (tree_view)), + GTK_TREE_SELECTION_MULTI); for (j = 0; j < 2; j++) for (i = 0; data[i].word_1 != NULL; i++) {