I#2219 - Calendar: Preserve Work Week view on date change, if possible
Closes https://gitlab.gnome.org/GNOME/evolution/-/issues/2219
This commit is contained in:
@ -535,16 +535,21 @@ cal_shell_content_datepicker_selection_changed_cb (ECalendarItem *calitem,
|
|||||||
e_cal_shell_content_change_view (cal_shell_content, E_CAL_VIEW_KIND_DAY, &sel_start, &sel_end, FALSE);
|
e_cal_shell_content_change_view (cal_shell_content, E_CAL_VIEW_KIND_DAY, &sel_start, &sel_end, FALSE);
|
||||||
} else if (selected_days == 7) {
|
} else if (selected_days == 7) {
|
||||||
GDateWeekday sel_start_wday;
|
GDateWeekday sel_start_wday;
|
||||||
|
ECalViewKind set_kind = E_CAL_VIEW_KIND_WEEK;
|
||||||
|
|
||||||
sel_start_wday = g_date_get_weekday (&sel_start);
|
sel_start_wday = g_date_get_weekday (&sel_start);
|
||||||
|
|
||||||
if (sel_start_wday == calitem->week_start_day &&
|
if (sel_start_wday == calitem->week_start_day &&
|
||||||
cal_shell_content->priv->current_view == E_CAL_VIEW_KIND_DAY &&
|
cal_shell_content->priv->current_view == E_CAL_VIEW_KIND_DAY &&
|
||||||
e_day_view_get_days_shown (E_DAY_VIEW (cal_shell_content->priv->views[E_CAL_VIEW_KIND_DAY])) == 7) {
|
e_day_view_get_days_shown (E_DAY_VIEW (cal_shell_content->priv->views[E_CAL_VIEW_KIND_DAY])) == 7) {
|
||||||
e_cal_shell_content_change_view (cal_shell_content, E_CAL_VIEW_KIND_DAY, &sel_start, &sel_end, FALSE);
|
set_kind = E_CAL_VIEW_KIND_DAY;
|
||||||
} else {
|
} else if (sel_start_wday == calitem->week_start_day &&
|
||||||
e_cal_shell_content_change_view (cal_shell_content, E_CAL_VIEW_KIND_WEEK, &sel_start, &sel_end, FALSE);
|
cal_shell_content->priv->current_view == E_CAL_VIEW_KIND_WORKWEEK &&
|
||||||
|
e_day_view_get_days_shown (E_DAY_VIEW (cal_shell_content->priv->views[E_CAL_VIEW_KIND_WORKWEEK])) == 7) {
|
||||||
|
set_kind = E_CAL_VIEW_KIND_WORKWEEK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
e_cal_shell_content_change_view (cal_shell_content, set_kind, &sel_start, &sel_end, FALSE);
|
||||||
} else {
|
} else {
|
||||||
if (cal_shell_content->priv->current_view == E_CAL_VIEW_KIND_LIST) {
|
if (cal_shell_content->priv->current_view == E_CAL_VIEW_KIND_LIST) {
|
||||||
/* whole month */
|
/* whole month */
|
||||||
|
Reference in New Issue
Block a user