aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/e-week-view-event-item.c
diff options
context:
space:
mode:
authorRodney Dawes <dobey@novell.com>2004-07-10 00:29:44 +0800
committerRodney Dawes <dobey@src.gnome.org>2004-07-10 00:29:44 +0800
commitc50f51b9c43bad4212e7680c51b795ae654d65ed (patch)
tree024c7728816382c5a4520fca3072bcc4a75d8e76 /calendar/gui/e-week-view-event-item.c
parent6e8aede2ccc77248fe05cf6e6de063a02bf33584 (diff)
downloadgsoc2013-evolution-c50f51b9c43bad4212e7680c51b795ae654d65ed.tar.gz
gsoc2013-evolution-c50f51b9c43bad4212e7680c51b795ae654d65ed.tar.zst
gsoc2013-evolution-c50f51b9c43bad4212e7680c51b795ae654d65ed.zip
Add an argument for the event_num so we can get the event object Draw the
2004-07-09 Rodney Dawes <dobey@novell.com> * gui/e-day-view-top-item.c (e_day_view_top_item_draw_triangle): Add an argument for the event_num so we can get the event object Draw the left/right triangles with the right color for the event Fix a small alignment bug with the triangle points * gui/e-week-view-event-item.c (e_week_view_event_item_draw_triangle): Draw the left/right triangles with the right color for the event Fix a small alignment bug with the triangle points svn path=/trunk/; revision=26609
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]);