aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--calendar/ChangeLog8
-rw-r--r--calendar/gui/e-day-view.c21
-rw-r--r--calendar/gui/e-week-view.c16
3 files changed, 31 insertions, 14 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog
index 8e9b676105..502fbb209c 100644
--- a/calendar/ChangeLog
+++ b/calendar/ChangeLog
@@ -1,5 +1,13 @@
2002-09-11 JP Rosevear <jpr@ximian.com>
+ * gui/e-day-view.c (e_day_view_on_top_canvas_button_press): keep
+ the selection if we right click in it (but not on an appointment)
+ (e_day_view_on_main_canvas_button_press): ditto
+
+ * gui/e-week-view.c (e_week_view_on_button_press): same
+
+2002-09-11 JP Rosevear <jpr@ximian.com>
+
* gui/e-week-view.c (e_week_view_new_appointment): create a new
appointment based on the selection
(e_week_view_on_button_press): use above
diff --git a/calendar/gui/e-day-view.c b/calendar/gui/e-day-view.c
index 31b71e473c..7a91699185 100644
--- a/calendar/gui/e-day-view.c
+++ b/calendar/gui/e-day-view.c
@@ -2295,7 +2295,7 @@ e_day_view_set_selected_time_range_in_top_visible (EDayView *day_view,
start_col = 0;
if (!end_in_grid)
end_col = day_view->days_shown - 1;
-
+
if (start_row != day_view->selection_start_row
|| start_col != day_view->selection_start_day) {
need_redraw = TRUE;
@@ -3091,9 +3091,11 @@ e_day_view_on_top_canvas_button_press (GtkWidget *widget,
if (!GTK_WIDGET_HAS_FOCUS (day_view))
gtk_widget_grab_focus (GTK_WIDGET (day_view));
- e_day_view_start_selection (day_view, day, -1);
- e_day_view_finish_selection (day_view);
-
+ if (day < day_view->selection_start_day || day > day_view->selection_end_day) {
+ e_day_view_start_selection (day_view, day, -1);
+ e_day_view_finish_selection (day_view);
+ }
+
e_day_view_on_event_right_click (day_view, event, -1, -1);
}
@@ -3228,9 +3230,14 @@ e_day_view_on_main_canvas_button_press (GtkWidget *widget,
if (!GTK_WIDGET_HAS_FOCUS (day_view))
gtk_widget_grab_focus (GTK_WIDGET (day_view));
- e_day_view_start_selection (day_view, day, row);
- e_day_view_finish_selection (day_view);
-
+
+ if ((day < day_view->selection_start_day || day > day_view->selection_end_day)
+ || (day == day_view->selection_start_day && row < day_view->selection_start_row)
+ || (day == day_view->selection_end_day && row > day_view->selection_end_row)) {
+ e_day_view_start_selection (day_view, day, row);
+ e_day_view_finish_selection (day_view);
+ }
+
e_day_view_on_event_right_click (day_view, event, -1, -1);
}
diff --git a/calendar/gui/e-week-view.c b/calendar/gui/e-week-view.c
index 756689b176..9d7d75d711 100644
--- a/calendar/gui/e-week-view.c
+++ b/calendar/gui/e-week-view.c
@@ -1468,7 +1468,7 @@ e_week_view_set_selected_time_range_visible (EWeekView *week_view,
g_return_if_fail (E_IS_WEEK_VIEW (week_view));
time_to_gdate_with_zone (&date, start_time, week_view->zone);
-
+
/* Set the selection to the given days. */
week_view->selection_start_day = g_date_julian (&date)
- g_date_julian (&week_view->first_day_shown);
@@ -2258,13 +2258,15 @@ e_week_view_on_button_press (GtkWidget *widget,
if (!GTK_WIDGET_HAS_FOCUS (week_view))
gtk_widget_grab_focus (GTK_WIDGET (week_view));
- week_view->selection_start_day = day;
- week_view->selection_end_day = day;
- week_view->selection_drag_pos = E_WEEK_VIEW_DRAG_NONE;
-
- /* FIXME: Optimise? */
- gtk_widget_queue_draw (week_view->main_canvas);
+ if (day < week_view->selection_start_day || day > week_view->selection_end_day) {
+ week_view->selection_start_day = day;
+ week_view->selection_end_day = day;
+ week_view->selection_drag_pos = E_WEEK_VIEW_DRAG_NONE;
+ /* FIXME: Optimise? */
+ gtk_widget_queue_draw (week_view->main_canvas);
+ }
+
e_week_view_show_popup_menu (week_view, event, -1);
}