aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui
diff options
context:
space:
mode:
authorJP Rosevear <jpr@ximian.com>2002-09-12 04:34:48 +0800
committerJP Rosevear <jpr@src.gnome.org>2002-09-12 04:34:48 +0800
commit5ee24ecb73357537623089e04bc38423c8ec3351 (patch)
tree6110c9cb76355a8bb233ffc64494eb26fdaf11d7 /calendar/gui
parent75455ef4a1650dddfec7b0ac79ec6584f51cc6f8 (diff)
downloadgsoc2013-evolution-5ee24ecb73357537623089e04bc38423c8ec3351.tar
gsoc2013-evolution-5ee24ecb73357537623089e04bc38423c8ec3351.tar.gz
gsoc2013-evolution-5ee24ecb73357537623089e04bc38423c8ec3351.tar.bz2
gsoc2013-evolution-5ee24ecb73357537623089e04bc38423c8ec3351.tar.lz
gsoc2013-evolution-5ee24ecb73357537623089e04bc38423c8ec3351.tar.xz
gsoc2013-evolution-5ee24ecb73357537623089e04bc38423c8ec3351.tar.zst
gsoc2013-evolution-5ee24ecb73357537623089e04bc38423c8ec3351.zip
keep the selection if we right click in it (but not on an appointment)
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): sam svn path=/trunk/; revision=18046
Diffstat (limited to 'calendar/gui')
-rw-r--r--calendar/gui/e-day-view.c21
-rw-r--r--calendar/gui/e-week-view.c16
2 files changed, 23 insertions, 14 deletions
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);
}