From 1e1f118e64f9ee4205daecced6fcbba77fc1abbb Mon Sep 17 00:00:00 2001 From: Christopher James Lahey Date: Wed, 5 Jun 2002 19:35:13 +0000 Subject: Bumped the version number to 0.19.99.17. 2002-06-05 Christopher James Lahey * configure.in: Bumped the version number to 0.19.99.17. * gal/widgets/e-reflow.c, gal/widgets/e-reflow.h (e_reflow_selection_event_real): Made this function handle GDK_BUTTON_RELEASE. Added a maybe_in_drag variable that the API user can set to 0 to indicate that a drag has occurred. svn path=/trunk/; revision=17122 --- widgets/misc/e-reflow.c | 23 ++++++++++++++++++++++- widgets/misc/e-reflow.h | 3 +++ 2 files changed, 25 insertions(+), 1 deletion(-) (limited to 'widgets') diff --git a/widgets/misc/e-reflow.c b/widgets/misc/e-reflow.c index 051cb3d2ab..fa0fd42de8 100644 --- a/widgets/misc/e-reflow.c +++ b/widgets/misc/e-reflow.c @@ -1216,7 +1216,13 @@ e_reflow_selection_event_real (EReflow *reflow, GnomeCanvasItem *item, GdkEvent case 1: /* Fall through. */ case 2: row = er_find_item (reflow, item); - e_selection_model_do_something(reflow->selection, row, 0, event->button.state); + if (event->button.button == 1) { + reflow->maybe_did_something = + e_selection_model_maybe_do_something(reflow->selection, row, 0, event->button.state); + reflow->maybe_in_drag = TRUE; + } else { + e_selection_model_do_something(reflow->selection, row, 0, event->button.state); + } break; case 3: row = er_find_item (reflow, item); @@ -1227,6 +1233,17 @@ e_reflow_selection_event_real (EReflow *reflow, GnomeCanvasItem *item, GdkEvent break; } break; + case GDK_BUTTON_RELEASE: + if (event->button.button == 1) { + if (reflow->maybe_in_drag) { + reflow->maybe_in_drag = FALSE; + if (!reflow->maybe_did_something) { + row = er_find_item (reflow, item); + e_selection_model_do_something(reflow->selection, row, 0, event->button.state); + } + } + } + break; case GDK_KEY_PRESS: return_val = e_selection_model_key_press(reflow->selection, (GdkEventKey *) event); break; @@ -1320,6 +1337,10 @@ e_reflow_init (EReflow *reflow) reflow->need_height_update = FALSE; reflow->need_column_resize = FALSE; + reflow->need_reflow_columns = FALSE; + + reflow->maybe_did_something = FALSE; + reflow->maybe_in_drag = FALSE; reflow->default_cursor_shown = TRUE; reflow->arrow_cursor = NULL; diff --git a/widgets/misc/e-reflow.h b/widgets/misc/e-reflow.h index 0aed25945c..7d002a0a69 100644 --- a/widgets/misc/e-reflow.h +++ b/widgets/misc/e-reflow.h @@ -112,6 +112,9 @@ struct _EReflow guint need_reflow_columns : 1; guint default_cursor_shown : 1; + + guint maybe_did_something : 1; + guint maybe_in_drag : 1; GdkCursor *arrow_cursor; GdkCursor *default_cursor; }; -- cgit v1.2.3