diff options
Diffstat (limited to 'calendar/gui/e-week-view-event-item.c')
-rw-r--r-- | calendar/gui/e-week-view-event-item.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/calendar/gui/e-week-view-event-item.c b/calendar/gui/e-week-view-event-item.c index ec0d5b8795..023b297992 100644 --- a/calendar/gui/e-week-view-event-item.c +++ b/calendar/gui/e-week-view-event-item.c @@ -558,6 +558,7 @@ e_week_view_event_item_draw_icons (EWeekViewEventItem *wveitem, GdkGC *gc; gint num_icons = 0, icon_x_inc; gboolean draw_reminder_icon = FALSE, draw_recurrence_icon = FALSE; + GSList *categories_list, *elem; week_view = E_WEEK_VIEW (GTK_WIDGET (GNOME_CANVAS_ITEM (wveitem)->canvas)->parent); @@ -579,6 +580,9 @@ e_week_view_event_item_draw_icons (EWeekViewEventItem *wveitem, num_icons++; } + cal_component_get_categories_list (comp, &categories_list); + num_icons += g_slist_length (categories_list); + icon_x_inc = E_WEEK_VIEW_ICON_WIDTH + E_WEEK_VIEW_ICON_X_PAD; if (right_align) @@ -606,6 +610,31 @@ e_week_view_event_item_draw_icons (EWeekViewEventItem *wveitem, icon_x += icon_x_inc; } + /* draw categories icons */ + for (elem = categories_list; elem; elem = elem->next) { + char *category; + GdkPixmap *pixmap; + GdkBitmap *mask; + + category = (char *) elem->data; + /* FIXME: get icon for this category */ + pixmap = week_view->recurrence_icon; + mask = week_view->recurrence_mask; + + if (icon_x + E_WEEK_VIEW_ICON_WIDTH <= x2) { + gdk_gc_set_clip_origin (gc, icon_x, icon_y); + gdk_gc_set_clip_mask (gc, mask); + gdk_draw_pixmap (drawable, gc, + pixmap, + 0, 0, icon_x, icon_y, + E_WEEK_VIEW_ICON_WIDTH, + E_WEEK_VIEW_ICON_HEIGHT); + icon_x += icon_x_inc; + } + } + + cal_component_free_categories_list (categories_list); + gdk_gc_set_clip_mask (gc, NULL); } |