aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/e-week-view-event-item.c
diff options
context:
space:
mode:
authorRodrigo Moya <rodrigo@src.gnome.org>2003-08-20 18:17:18 +0800
committerRodrigo Moya <rodrigo@src.gnome.org>2003-08-20 18:17:18 +0800
commit4ad72d24ee36553c85c1bbf21b22c46f77c2ac82 (patch)
tree048f40b08f5a0e42df0f2a5567158174b228bdea /calendar/gui/e-week-view-event-item.c
parentba861603f446ca0fd9b4cf72f0f8357c306ce953 (diff)
downloadgsoc2013-evolution-4ad72d24ee36553c85c1bbf21b22c46f77c2ac82.tar
gsoc2013-evolution-4ad72d24ee36553c85c1bbf21b22c46f77c2ac82.tar.gz
gsoc2013-evolution-4ad72d24ee36553c85c1bbf21b22c46f77c2ac82.tar.bz2
gsoc2013-evolution-4ad72d24ee36553c85c1bbf21b22c46f77c2ac82.tar.lz
gsoc2013-evolution-4ad72d24ee36553c85c1bbf21b22c46f77c2ac82.tar.xz
gsoc2013-evolution-4ad72d24ee36553c85c1bbf21b22c46f77c2ac82.tar.zst
gsoc2013-evolution-4ad72d24ee36553c85c1bbf21b22c46f77c2ac82.zip
Merged from calendar-views-with-model branch
svn path=/trunk/; revision=22308
Diffstat (limited to 'calendar/gui/e-week-view-event-item.c')
-rw-r--r--calendar/gui/e-week-view-event-item.c46
1 files changed, 40 insertions, 6 deletions
diff --git a/calendar/gui/e-week-view-event-item.c b/calendar/gui/e-week-view-event-item.c
index 37318141a9..139f28bb13 100644
--- a/calendar/gui/e-week-view-event-item.c
+++ b/calendar/gui/e-week-view-event-item.c
@@ -236,6 +236,7 @@ e_week_view_event_item_draw (GnomeCanvasItem *canvas_item,
gboolean draw_start, draw_end;
gboolean draw_start_triangle = FALSE, draw_end_triangle = FALSE;
GdkRectangle clip_rect;
+ GdkColor bg_color;
#if 0
g_print ("In e_week_view_event_item_draw %i,%i %ix%i\n",
@@ -282,7 +283,29 @@ e_week_view_event_item_draw (GnomeCanvasItem *canvas_item,
one_day_event = e_week_view_is_one_day_event (week_view,
wveitem->event_num);
if (one_day_event) {
- time_x = x1 + E_WEEK_VIEW_EVENT_L_PAD;
+ time_x = x1 + E_WEEK_VIEW_EVENT_L_PAD + 1;
+ rect_x = x1 + E_WEEK_VIEW_EVENT_L_PAD;
+ rect_w = x2 - x1 - E_WEEK_VIEW_EVENT_L_PAD - E_WEEK_VIEW_EVENT_R_PAD + 1;
+
+ if (gdk_color_parse (e_cal_model_get_color_for_component (e_cal_view_get_model (E_CAL_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_rectangle (drawable, gc, TRUE, rect_x, y1 + 1, rect_w, y2 - y1 - 1);
+
+ gdk_gc_set_foreground (gc, &week_view->colors[E_WEEK_VIEW_COLOR_EVENT_BORDER]);
+ gdk_draw_line (drawable, gc, rect_x, y1 + 1, rect_x + rect_w, y1 + 1);
+ gdk_draw_line (drawable, gc, rect_x, y2, rect_x + rect_w, y2);
+ gdk_draw_line (drawable, gc, rect_x, y1 + 1, rect_x, y1 + (y2 - (y1 + 1)));
+ gdk_draw_line (drawable, gc, rect_x + rect_w, y1 + 1, rect_x + rect_w, y1 + (y2 - (y1 + 1)));
/* Draw the start and end times, as required. */
switch (week_view->time_format) {
@@ -354,9 +377,19 @@ e_week_view_event_item_draw (GnomeCanvasItem *canvas_item,
rect_w -= 2;
}
- gdk_gc_set_foreground (gc, &week_view->colors[E_WEEK_VIEW_COLOR_EVENT_BACKGROUND]);
- gdk_draw_rectangle (drawable, gc, TRUE,
- rect_x, y1 + 1, rect_w, y2 - y1 - 1);
+ if (gdk_color_parse (e_cal_model_get_color_for_component (e_cal_view_get_model (E_CAL_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_rectangle (drawable, gc, TRUE, rect_x, y1 + 1, rect_w, y2 - y1 - 1);
gdk_gc_set_foreground (gc, &week_view->colors[E_WEEK_VIEW_COLOR_EVENT_BORDER]);
rect_x2 = rect_x + rect_w - 1;
@@ -572,7 +605,8 @@ e_week_view_event_item_draw_icons (EWeekViewEventItem *wveitem,
wveitem->event_num);
span = &g_array_index (week_view->spans, EWeekViewEventSpan,
event->spans_index + wveitem->span_num);
- comp = event->comp;
+ comp = cal_component_new ();
+ cal_component_set_icalcomponent (comp, icalcomponent_new_clone (event->comp_data->icalcomp));
gc = week_view->main_gc;
@@ -870,7 +904,7 @@ e_week_view_event_item_double_click (EWeekViewEventItem *wveitem,
calendar = e_cal_view_get_calendar (E_CAL_VIEW (week_view));
if (calendar)
- gnome_calendar_edit_object (calendar, event->comp, FALSE);
+ gnome_calendar_edit_object (calendar, event->comp_data->client, event->comp_data->icalcomp, FALSE);
else
g_warning ("Calendar not set");