aboutsummaryrefslogtreecommitdiffstats
path: root/modules/calendar/e-cal-shell-view-private.c
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2011-05-13 22:55:33 +0800
committerMilan Crha <mcrha@redhat.com>2011-05-13 22:55:33 +0800
commitbd86dd54026ddae9d921adefb7055d8271afa89e (patch)
tree343250f20d439b2f72fa9752ff0c2acd0d0d6383 /modules/calendar/e-cal-shell-view-private.c
parent998b265b135da1b373d6e20e5c9a3b405ca26163 (diff)
downloadgsoc2013-evolution-bd86dd54026ddae9d921adefb7055d8271afa89e.tar.gz
gsoc2013-evolution-bd86dd54026ddae9d921adefb7055d8271afa89e.tar.zst
gsoc2013-evolution-bd86dd54026ddae9d921adefb7055d8271afa89e.zip
Bug #243938 - Clicking on week numbers changes work week to week view
Diffstat (limited to 'modules/calendar/e-cal-shell-view-private.c')
-rw-r--r--modules/calendar/e-cal-shell-view-private.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/modules/calendar/e-cal-shell-view-private.c b/modules/calendar/e-cal-shell-view-private.c
index 412e5a2521..29a743b6e2 100644
--- a/modules/calendar/e-cal-shell-view-private.c
+++ b/modules/calendar/e-cal-shell-view-private.c
@@ -92,7 +92,7 @@ cal_shell_view_date_navigator_selection_changed_cb (ECalShellView *cal_shell_vie
icaltimezone *timezone;
time_t start, end, new_time;
gboolean starts_on_week_start_day;
- gint new_days_shown;
+ gint new_days_shown, old_days_shown;
gint week_start_day;
cal_shell_content = cal_shell_view->priv->cal_shell_content;
@@ -136,6 +136,9 @@ cal_shell_view_date_navigator_selection_changed_cb (ECalShellView *cal_shell_vie
g_date_compare (&end_date, &new_end_date) == 0)
return;
+ old_days_shown =
+ g_date_get_julian (&end_date) -
+ g_date_get_julian (&start_date) + 1;
new_days_shown =
g_date_get_julian (&new_end_date) -
g_date_get_julian (&new_start_date) + 1;
@@ -156,7 +159,10 @@ cal_shell_view_date_navigator_selection_changed_cb (ECalShellView *cal_shell_vie
/* Switch views as appropriate, and change the number of
* days or weeks shown. */
- if (new_days_shown > 9) {
+ if (view_type == GNOME_CAL_WORK_WEEK_VIEW && old_days_shown == new_days_shown) {
+ /* keep the work week view when has same days shown */
+ switch_to = GNOME_CAL_WORK_WEEK_VIEW;
+ } else if (new_days_shown > 9) {
if (view_type != GNOME_CAL_LIST_VIEW) {
ECalendarView *calendar_view;