aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/e-week-view-event-item.c
diff options
context:
space:
mode:
Diffstat (limited to 'calendar/gui/e-week-view-event-item.c')
-rw-r--r--calendar/gui/e-week-view-event-item.c21
1 files changed, 19 insertions, 2 deletions
diff --git a/calendar/gui/e-week-view-event-item.c b/calendar/gui/e-week-view-event-item.c
index 22f33ebe43..ff07eea6ba 100644
--- a/calendar/gui/e-week-view-event-item.c
+++ b/calendar/gui/e-week-view-event-item.c
@@ -725,22 +725,39 @@ e_week_view_event_item_draw_triangle (EWeekViewEventItem *wveitem,
gint h)
{
EWeekView *week_view;
+ EWeekViewEvent *event;
GdkGC *gc;
+ GdkColor bg_color;
GdkPoint points[3];
gint c1, c2;
week_view = E_WEEK_VIEW (GTK_WIDGET (GNOME_CANVAS_ITEM (wveitem)->canvas)->parent);
+ event = &g_array_index (week_view->events, EWeekViewEvent,
+ wveitem->event_num);
+
gc = week_view->main_gc;
points[0].x = x;
points[0].y = y;
points[1].x = x + w;
- points[1].y = y + (h / 2) - 1;
+ points[1].y = y + (h / 2);
points[2].x = x;
points[2].y = y + h - 1;
- gdk_gc_set_foreground (gc, &week_view->colors[E_WEEK_VIEW_COLOR_EVENT_BACKGROUND]);
+ if (gdk_color_parse (e_cal_model_get_color_for_component (e_calendar_view_get_model (E_CALENDAR_VIEW (week_view)),
+ event->comp_data),
+ &bg_color)) {
+ GdkColormap *colormap;
+
+ colormap = gtk_widget_get_colormap (GTK_WIDGET (week_view));
+ if (gdk_colormap_alloc_color (colormap, &bg_color, TRUE, TRUE))
+ gdk_gc_set_foreground (gc, &bg_color);
+ else
+ gdk_gc_set_foreground (gc, &week_view->colors[E_WEEK_VIEW_COLOR_EVENT_BACKGROUND]);
+ } else
+ gdk_gc_set_foreground (gc, &week_view->colors[E_WEEK_VIEW_COLOR_EVENT_BACKGROUND]);
+
gdk_draw_polygon (drawable, gc, TRUE, points, 3);
gdk_gc_set_foreground (gc, &week_view->colors[E_WEEK_VIEW_COLOR_EVENT_BORDER]);