diff options
author | Milan Crha <mcrha@redhat.com> | 2011-05-13 22:55:33 +0800 |
---|---|---|
committer | Rodrigo Moya <rodrigo@gnome-db.org> | 2011-06-30 00:42:15 +0800 |
commit | a79844ab0d4d3b62b85fe8da73d08c80d9cdc375 (patch) | |
tree | 5ea711a5dc59e90a8416bdd0e735bc8465b48528 /modules/calendar/e-cal-shell-view-private.c | |
parent | 757c1ded565f66497fe6e617cbb618ee81004328 (diff) | |
download | gsoc2013-evolution-a79844ab0d4d3b62b85fe8da73d08c80d9cdc375.tar gsoc2013-evolution-a79844ab0d4d3b62b85fe8da73d08c80d9cdc375.tar.gz gsoc2013-evolution-a79844ab0d4d3b62b85fe8da73d08c80d9cdc375.tar.bz2 gsoc2013-evolution-a79844ab0d4d3b62b85fe8da73d08c80d9cdc375.tar.lz gsoc2013-evolution-a79844ab0d4d3b62b85fe8da73d08c80d9cdc375.tar.xz gsoc2013-evolution-a79844ab0d4d3b62b85fe8da73d08c80d9cdc375.tar.zst gsoc2013-evolution-a79844ab0d4d3b62b85fe8da73d08c80d9cdc375.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.c | 10 |
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; |