diff options
Diffstat (limited to 'calendar/gui/e-day-view-main-item.c')
-rw-r--r-- | calendar/gui/e-day-view-main-item.c | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/calendar/gui/e-day-view-main-item.c b/calendar/gui/e-day-view-main-item.c index cc6224987a..d65193b08b 100644 --- a/calendar/gui/e-day-view-main-item.c +++ b/calendar/gui/e-day-view-main-item.c @@ -467,7 +467,7 @@ e_day_view_main_item_draw_day_event (EDayViewMainItem *dvmitem, CalComponent *comp; gint num_icons, icon_x, icon_y, icon_x_inc, icon_y_inc; gint max_icon_w, max_icon_h; - gboolean draw_reminder_icon, draw_recurrence_icon; + gboolean draw_reminder_icon, draw_recurrence_icon, draw_timezone_icon; GSList *categories_list, *elem; day_view = dvmitem->day_view; @@ -563,6 +563,7 @@ e_day_view_main_item_draw_day_event (EDayViewMainItem *dvmitem, num_icons = 0; draw_reminder_icon = FALSE; draw_recurrence_icon = FALSE; + draw_timezone_icon = FALSE; icon_x = item_x + E_DAY_VIEW_BAR_WIDTH + E_DAY_VIEW_ICON_X_PAD; icon_y = item_y + E_DAY_VIEW_EVENT_BORDER_HEIGHT + E_DAY_VIEW_ICON_Y_PAD; @@ -578,6 +579,14 @@ e_day_view_main_item_draw_day_event (EDayViewMainItem *dvmitem, num_icons++; } + /* If the DTSTART or DTEND are in a different timezone to our current + timezone, we display the timezone icon. */ + if (!cal_component_compare_event_timezone (comp, day_view->zone)) { + draw_timezone_icon = TRUE; + num_icons++; + } + + cal_component_get_categories_list (comp, &categories_list); num_icons += g_slist_length (categories_list); @@ -632,6 +641,25 @@ e_day_view_main_item_draw_day_event (EDayViewMainItem *dvmitem, icon_y += icon_y_inc; } + if (draw_timezone_icon) { + max_icon_w = item_x + item_w - icon_x + - E_DAY_VIEW_EVENT_BORDER_WIDTH; + max_icon_h = item_y + item_h - icon_y + - E_DAY_VIEW_EVENT_BORDER_HEIGHT; + + gdk_gc_set_clip_origin (gc, icon_x, icon_y); + gdk_gc_set_clip_mask (gc, day_view->timezone_mask); + gdk_draw_pixmap (drawable, gc, + day_view->timezone_icon, + 0, 0, icon_x, icon_y, + MIN (E_DAY_VIEW_ICON_WIDTH, + max_icon_w), + MIN (E_DAY_VIEW_ICON_HEIGHT, + max_icon_h)); + icon_x += icon_x_inc; + icon_y += icon_y_inc; + } + /* draw categories icons */ for (elem = categories_list; elem; elem = elem->next) { char *category; |