Re: [evolution-patches] patches for #6767



Does this one ok? I use light[GTK_STATE_NORMAL] for top canvas grid
because the top canvas' color is dark[GTK_STATE_NORMAL], and use
dark[GTK_STATE_NORMAL] for other grids.
JP Rosevear wrote:

On Tue, 2004-10-26 at 17:34 +0800, Li Yuan wrote:
Hi,

attaches are patches to fix #6767. i am not sure the colors i choose are right.
please review them and give me some suggestions.

In general, the patch looks good.  As for colors, it shouldn't really
use INSENSITIVE for the grid lines or event borders, perhaps it could
use a combination of NORMAL dark/light for those?

-JP

? gui/dialogs/alarm-dialog.gladep
? gui/dialogs/cal-prefs-dialog.gladep
? gui/dialogs/event-page.gladep
? gui/dialogs/meeting-page.gladep
? gui/dialogs/task-page.gladep
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/calendar/ChangeLog,v
retrieving revision 1.2554
diff -u -r1.2554 ChangeLog
--- ChangeLog	21 Oct 2004 17:07:23 -0000	1.2554
+++ ChangeLog	30 Oct 2004 04:04:41 -0000
@@ -1,3 +1,19 @@
+2004-10-26  Li Yuan  <li yuan sun com>
+
+	* gui/e-day-view-main-item.c:
+	(e_day_view_main_item_draw_day_event):
+	use widget->style instead of hard code colors.
+	* gui/e-day-view.c: (e_day_view_realize), (e_day_view_set_colors),
+	(e_day_view_style_set), (e_day_view_reshape_long_event),
+	(e_day_view_reshape_day_event):
+	ditto.
+	* gui/e-week-view.c: (e_week_view_realize),
+	(e_week_view_set_colors), (e_week_view_style_set),
+	(e_week_view_reshape_event_span):
+	ditto.
+
+	Fixes #6767
+
 2004-10-21  Harish Krishnaswamy  <kharish novell com>
 
 	* gui/e-cal-popup.[ch]: (e_cal_popup_target_new_source):
Index: gui/e-day-view-main-item.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/e-day-view-main-item.c,v
retrieving revision 1.38
diff -u -r1.38 e-day-view-main-item.c
--- gui/e-day-view-main-item.c	14 Oct 2004 14:44:41 -0000	1.38
+++ gui/e-day-view-main-item.c	30 Oct 2004 04:04:44 -0000
@@ -500,6 +500,8 @@
 	   since that is used for multiple events. But then you can't see
 	   where the event in the first column finishes. */
 
+	gdk_gc_set_foreground (gc, &day_view->colors[E_DAY_VIEW_COLOR_EVENT_BACKGROUND]);
+
 	if (gdk_color_parse (e_cal_model_get_color_for_component (e_calendar_view_get_model (E_CALENDAR_VIEW (day_view)), event->comp_data),
 			     &bg_color)) {
 		GdkColormap *colormap;
@@ -524,7 +526,8 @@
 	gdk_gc_set_foreground (gc, &day_view->colors[E_DAY_VIEW_COLOR_EVENT_VBAR]);
 
 	/* Draw the right edge of the vertical bar. */
-	gdk_draw_line (drawable, style->black_gc,
+	gdk_gc_set_foreground (gc, &day_view->colors[E_DAY_VIEW_COLOR_EVENT_BORDER]);
+	gdk_draw_line (drawable, gc,
 		       item_x + E_DAY_VIEW_BAR_WIDTH - 1,
 		       item_y + 1,
 		       item_x + E_DAY_VIEW_BAR_WIDTH - 1,
@@ -551,6 +554,7 @@
 	/* Only fill it in if the event isn't TRANSPARENT. */
 	e_cal_component_get_transparency (comp, &transparency);
 	if (transparency != E_CAL_COMPONENT_TRANSP_TRANSPARENT) {
+		gdk_gc_set_foreground (gc, &day_view->colors[E_DAY_VIEW_COLOR_EVENT_VBAR]);
 		gdk_draw_rectangle (drawable, gc, TRUE,
 				    item_x + 1, bar_y1,
 				    E_DAY_VIEW_BAR_WIDTH - 2, bar_y2 - bar_y1);
@@ -559,8 +563,10 @@
 	/* Draw the box around the entire event. Do this after drawing
 	   the colored bar so we don't have to worry about being 1
 	   pixel out. */
-	gdk_draw_rectangle (drawable, style->black_gc, FALSE,
+	gdk_gc_set_foreground (gc, &day_view->colors[E_DAY_VIEW_COLOR_EVENT_BORDER]);
+	gdk_draw_rectangle (drawable, gc, FALSE,
 			    item_x, item_y, MAX (item_w - 1, 0), item_h - 1);
+	gdk_gc_set_foreground (gc, &day_view->colors[E_DAY_VIEW_COLOR_EVENT_VBAR]);
 
 #if 0
 	/* Draw the horizontal bars above and beneath the event if it
Index: gui/e-day-view.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/e-day-view.c,v
retrieving revision 1.256
diff -u -r1.256 e-day-view.c
--- gui/e-day-view.c	19 Oct 2004 16:20:07 -0000	1.256
+++ gui/e-day-view.c	30 Oct 2004 04:04:59 -0000
@@ -123,6 +123,7 @@
 
 static void e_day_view_destroy (GtkObject *object);
 static void e_day_view_realize (GtkWidget *widget);
+static void e_day_view_set_colors(EDayView *day_view, GtkWidget *widget);
 static void e_day_view_unrealize (GtkWidget *widget);
 static void e_day_view_style_set (GtkWidget *widget,
 				  GtkStyle  *previous_style);
@@ -1151,64 +1152,9 @@
 	colormap = gtk_widget_get_colormap (widget);
 
 	/* Allocate the colors. */
-	day_view->colors[E_DAY_VIEW_COLOR_BG_WORKING].red   = 247 * 257;
-	day_view->colors[E_DAY_VIEW_COLOR_BG_WORKING].green = 247 * 257;
-	day_view->colors[E_DAY_VIEW_COLOR_BG_WORKING].blue  = 244 * 257;
-
-	day_view->colors[E_DAY_VIEW_COLOR_BG_NOT_WORKING].red   = 216 * 257;
-	day_view->colors[E_DAY_VIEW_COLOR_BG_NOT_WORKING].green = 216 * 257;
-	day_view->colors[E_DAY_VIEW_COLOR_BG_NOT_WORKING].blue  = 214 * 257;
-
-	day_view->colors[E_DAY_VIEW_COLOR_BG_SELECTED].red   = 0 * 257;
-	day_view->colors[E_DAY_VIEW_COLOR_BG_SELECTED].green = 0 * 257;
-	day_view->colors[E_DAY_VIEW_COLOR_BG_SELECTED].blue  = 156 * 257;
-
-	day_view->colors[E_DAY_VIEW_COLOR_BG_SELECTED_UNFOCUSSED].red   = 16 * 257;
-	day_view->colors[E_DAY_VIEW_COLOR_BG_SELECTED_UNFOCUSSED].green = 78 * 257;
-	day_view->colors[E_DAY_VIEW_COLOR_BG_SELECTED_UNFOCUSSED].blue  = 139 * 257;
-
-	day_view->colors[E_DAY_VIEW_COLOR_BG_GRID].red   = 0x8000;
-	day_view->colors[E_DAY_VIEW_COLOR_BG_GRID].green = 0x8000;
-	day_view->colors[E_DAY_VIEW_COLOR_BG_GRID].blue  = 0x8000;
-
-	day_view->colors[E_DAY_VIEW_COLOR_BG_TOP_CANVAS].red   = 0x8000;
-	day_view->colors[E_DAY_VIEW_COLOR_BG_TOP_CANVAS].green = 0x8000;
-	day_view->colors[E_DAY_VIEW_COLOR_BG_TOP_CANVAS].blue  = 0x8000;
-
-	day_view->colors[E_DAY_VIEW_COLOR_BG_TOP_CANVAS_SELECTED].red   = 65535;
-	day_view->colors[E_DAY_VIEW_COLOR_BG_TOP_CANVAS_SELECTED].green = 65535;
-	day_view->colors[E_DAY_VIEW_COLOR_BG_TOP_CANVAS_SELECTED].blue  = 65535;
-
-	day_view->colors[E_DAY_VIEW_COLOR_BG_TOP_CANVAS_GRID].red   = 0;
-	day_view->colors[E_DAY_VIEW_COLOR_BG_TOP_CANVAS_GRID].green = 0;
-	day_view->colors[E_DAY_VIEW_COLOR_BG_TOP_CANVAS_GRID].blue  = 0;
-
-	day_view->colors[E_DAY_VIEW_COLOR_EVENT_VBAR].red   = 0;
-	day_view->colors[E_DAY_VIEW_COLOR_EVENT_VBAR].green = 0;
-	day_view->colors[E_DAY_VIEW_COLOR_EVENT_VBAR].blue  = 65535;
-
-	day_view->colors[E_DAY_VIEW_COLOR_EVENT_BACKGROUND].red   = 65535;
-	day_view->colors[E_DAY_VIEW_COLOR_EVENT_BACKGROUND].green = 65535;
-	day_view->colors[E_DAY_VIEW_COLOR_EVENT_BACKGROUND].blue  = 65535;
-
-	day_view->colors[E_DAY_VIEW_COLOR_EVENT_BORDER].red   = 0;
-	day_view->colors[E_DAY_VIEW_COLOR_EVENT_BORDER].green = 0;
-	day_view->colors[E_DAY_VIEW_COLOR_EVENT_BORDER].blue  = 0;
-
-	day_view->colors[E_DAY_VIEW_COLOR_LONG_EVENT_BACKGROUND].red   = 213 * 257;
-	day_view->colors[E_DAY_VIEW_COLOR_LONG_EVENT_BACKGROUND].green = 213 * 257;
-	day_view->colors[E_DAY_VIEW_COLOR_LONG_EVENT_BACKGROUND].blue  = 213 * 257;
-
-	day_view->colors[E_DAY_VIEW_COLOR_LONG_EVENT_BORDER].red   = 0;
-	day_view->colors[E_DAY_VIEW_COLOR_LONG_EVENT_BORDER].green = 0;
-	day_view->colors[E_DAY_VIEW_COLOR_LONG_EVENT_BORDER].blue  = 0;
-
-	nfailed = gdk_colormap_alloc_colors (colormap, day_view->colors,
-					     E_DAY_VIEW_COLOR_LAST, FALSE,
-					     TRUE, success);
-	if (nfailed)
-		g_warning ("Failed to allocate all colors");
-
+	
+	e_day_view_set_colors(day_view, widget);
+	
 	gdk_gc_set_colormap (day_view->main_gc, colormap);
 
 	/* Create the pixmaps. */
@@ -1262,6 +1208,23 @@
 			       NULL);
 }
 
+static void
+e_day_view_set_colors(EDayView *day_view, GtkWidget *widget)
+{
+	day_view->colors[E_DAY_VIEW_COLOR_BG_WORKING] = widget->style->base[GTK_STATE_NORMAL];
+	day_view->colors[E_DAY_VIEW_COLOR_BG_NOT_WORKING] = widget->style->bg[GTK_STATE_ACTIVE];
+	day_view->colors[E_DAY_VIEW_COLOR_BG_SELECTED] = widget->style->base[GTK_STATE_SELECTED];
+	day_view->colors[E_DAY_VIEW_COLOR_BG_SELECTED_UNFOCUSSED] = widget->style->bg[GTK_STATE_SELECTED];
+	day_view->colors[E_DAY_VIEW_COLOR_BG_GRID] = widget->style->dark[GTK_STATE_NORMAL];
+	day_view->colors[E_DAY_VIEW_COLOR_BG_TOP_CANVAS] = widget->style->dark[GTK_STATE_NORMAL];
+	day_view->colors[E_DAY_VIEW_COLOR_BG_TOP_CANVAS_SELECTED] = widget->style->bg[GTK_STATE_SELECTED];
+	day_view->colors[E_DAY_VIEW_COLOR_BG_TOP_CANVAS_GRID] = widget->style->light[GTK_STATE_NORMAL];
+	day_view->colors[E_DAY_VIEW_COLOR_EVENT_VBAR] = widget->style->base[GTK_STATE_SELECTED];
+	day_view->colors[E_DAY_VIEW_COLOR_EVENT_BACKGROUND] = widget->style->base[GTK_STATE_NORMAL];
+	day_view->colors[E_DAY_VIEW_COLOR_EVENT_BORDER] = widget->style->dark[GTK_STATE_NORMAL];
+	day_view->colors[E_DAY_VIEW_COLOR_LONG_EVENT_BACKGROUND] = widget->style->bg[GTK_STATE_ACTIVE];
+	day_view->colors[E_DAY_VIEW_COLOR_LONG_EVENT_BORDER] = widget->style->dark[GTK_STATE_NORMAL];
+}
 
 static void
 e_day_view_unrealize (GtkWidget *widget)
@@ -1309,11 +1272,39 @@
 	PangoContext *pango_context;
 	PangoFontMetrics *font_metrics;
 	PangoLayout *layout;
+	gint week_day, event_num;
+	EDayViewEvent *event;
 
 	if (GTK_WIDGET_CLASS (e_day_view_parent_class)->style_set)
 		(*GTK_WIDGET_CLASS (e_day_view_parent_class)->style_set)(widget, previous_style);
 
 	day_view = E_DAY_VIEW (widget);
+	e_day_view_set_colors(day_view, widget);
+
+	for (week_day = 0; week_day < E_DAY_VIEW_MAX_DAYS; week_day++){
+		for (event_num = 0; event_num < day_view->events[week_day]->len; event_num++) {
+			event = &g_array_index (day_view->events[week_day], EDayViewEvent, event_num);
+			if (event->canvas_item)
+				gnome_canvas_item_set (event->canvas_item,
+						"fill_color_gdk", &widget->style->text[GTK_STATE_NORMAL],
+						NULL);
+		}
+	}
+	for (event_num = 0; event_num < day_view->long_events->len; event_num++) {
+		event = &g_array_index (day_view->long_events, EDayViewEvent, event_num);
+		if (event->canvas_item)
+			gnome_canvas_item_set (event->canvas_item,
+					"fill_color_gdk", &widget->style->text[GTK_STATE_NORMAL],
+					NULL);
+	}
+	gnome_canvas_item_set (day_view->main_canvas_top_resize_bar_item,
+			"fill_color_gdk", &day_view->colors[E_DAY_VIEW_COLOR_EVENT_VBAR],
+			"outline_color_gdk", &day_view->colors[E_DAY_VIEW_COLOR_EVENT_BORDER],
+			NULL);
+	gnome_canvas_item_set (day_view->main_canvas_bottom_resize_bar_item,
+			"fill_color_gdk", &day_view->colors[E_DAY_VIEW_COLOR_EVENT_VBAR],
+			"outline_color_gdk", &day_view->colors[E_DAY_VIEW_COLOR_EVENT_BORDER],
+			NULL);
 
 	/* Set up Pango prerequisites */
 	font_desc = gtk_widget_get_style (widget)->font_desc;
@@ -4349,6 +4340,9 @@
 	}
 
 	if (!event->canvas_item) {
+		GtkWidget *widget;
+
+		widget = (GtkWidget *)day_view;
 		event->canvas_item =
 			gnome_canvas_item_new (GNOME_CANVAS_GROUP (GNOME_CANVAS (day_view->top_canvas)->root),
 					       e_text_get_type (),
@@ -4358,7 +4352,7 @@
 					       "editable", TRUE,
 					       "use_ellipsis", TRUE,
 					       "draw_background", FALSE,
-					       "fill_color_rgba", GNOME_CANVAS_COLOR (0, 0, 0),
+					       "fill_color_gdk", &widget->style->text[GTK_STATE_NORMAL],
 					       "im_context", E_CANVAS (day_view->top_canvas)->im_context,
 					       NULL);
 		g_signal_connect (event->canvas_item, "event",
@@ -4523,6 +4517,9 @@
 		}
 
 		if (!event->canvas_item) {
+			GtkWidget *widget;
+
+			widget = (GtkWidget *)day_view;
 			event->canvas_item =
 				gnome_canvas_item_new (GNOME_CANVAS_GROUP (GNOME_CANVAS (day_view->main_canvas)->root),
 						       e_text_get_type (),
@@ -4532,7 +4529,7 @@
 						       "clip", TRUE,
 						       "use_ellipsis", TRUE,
 						       "draw_background", FALSE,
-						       "fill_color_rgba", GNOME_CANVAS_COLOR(0, 0, 0),
+						       "fill_color_gdk", &widget->style->text[GTK_STATE_NORMAL],
 						       "im_context", E_CANVAS (day_view->main_canvas)->im_context,
 						       NULL);
 			g_signal_connect (event->canvas_item, "event",
Index: gui/e-week-view.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/e-week-view.c,v
retrieving revision 1.227
diff -u -r1.227 e-week-view.c
--- gui/e-week-view.c	14 Oct 2004 14:56:18 -0000	1.227
+++ gui/e-week-view.c	30 Oct 2004 04:05:11 -0000
@@ -96,6 +96,7 @@
 
 static void e_week_view_destroy (GtkObject *object);
 static void e_week_view_realize (GtkWidget *widget);
+static void e_week_view_set_colors(EWeekView *week_view, GtkWidget *widget);
 static void e_week_view_unrealize (GtkWidget *widget);
 static void e_week_view_style_set (GtkWidget *widget,
 				   GtkStyle  *previous_style);
@@ -754,56 +755,8 @@
 	colormap = gtk_widget_get_colormap (widget);
 
 	/* Allocate the colors. */
-	week_view->colors[E_WEEK_VIEW_COLOR_EVEN_MONTHS].red   = 0xe0e0;
-	week_view->colors[E_WEEK_VIEW_COLOR_EVEN_MONTHS].green = 0xe0e0;
-	week_view->colors[E_WEEK_VIEW_COLOR_EVEN_MONTHS].blue  = 0xe0e0;
-
-	week_view->colors[E_WEEK_VIEW_COLOR_ODD_MONTHS].red   = 65535;
-	week_view->colors[E_WEEK_VIEW_COLOR_ODD_MONTHS].green = 65535;
-	week_view->colors[E_WEEK_VIEW_COLOR_ODD_MONTHS].blue  = 65535;
-
-	week_view->colors[E_WEEK_VIEW_COLOR_EVENT_BACKGROUND].red   = 213 * 257;
-	week_view->colors[E_WEEK_VIEW_COLOR_EVENT_BACKGROUND].green = 213 * 257;
-	week_view->colors[E_WEEK_VIEW_COLOR_EVENT_BACKGROUND].blue  = 213 * 257;
-
-	week_view->colors[E_WEEK_VIEW_COLOR_EVENT_BORDER].red   = 0;
-	week_view->colors[E_WEEK_VIEW_COLOR_EVENT_BORDER].green = 0;
-	week_view->colors[E_WEEK_VIEW_COLOR_EVENT_BORDER].blue  = 0;
-
-	week_view->colors[E_WEEK_VIEW_COLOR_EVENT_TEXT].red   = 0;
-	week_view->colors[E_WEEK_VIEW_COLOR_EVENT_TEXT].green = 0;
-	week_view->colors[E_WEEK_VIEW_COLOR_EVENT_TEXT].blue  = 0;
-
-	week_view->colors[E_WEEK_VIEW_COLOR_GRID].red   = 0 * 257;
-	week_view->colors[E_WEEK_VIEW_COLOR_GRID].green = 0 * 257;
-	week_view->colors[E_WEEK_VIEW_COLOR_GRID].blue  = 0 * 257;
-
-	week_view->colors[E_WEEK_VIEW_COLOR_SELECTED].red   = 0 * 257;
-	week_view->colors[E_WEEK_VIEW_COLOR_SELECTED].green = 0 * 257;
-	week_view->colors[E_WEEK_VIEW_COLOR_SELECTED].blue  = 156 * 257;
-
-	week_view->colors[E_WEEK_VIEW_COLOR_SELECTED_UNFOCUSSED].red   = 16 * 257;
-	week_view->colors[E_WEEK_VIEW_COLOR_SELECTED_UNFOCUSSED].green = 78 * 257;
-	week_view->colors[E_WEEK_VIEW_COLOR_SELECTED_UNFOCUSSED].blue  = 139 * 257;
-
-	week_view->colors[E_WEEK_VIEW_COLOR_DATES].red   = 0 * 257;
-	week_view->colors[E_WEEK_VIEW_COLOR_DATES].green = 0 * 257;
-	week_view->colors[E_WEEK_VIEW_COLOR_DATES].blue  = 0 * 257;
-
-	week_view->colors[E_WEEK_VIEW_COLOR_DATES_SELECTED].red   = 65535;
-	week_view->colors[E_WEEK_VIEW_COLOR_DATES_SELECTED].green = 65535;
-	week_view->colors[E_WEEK_VIEW_COLOR_DATES_SELECTED].blue  = 65535;
-
-	week_view->colors[E_WEEK_VIEW_COLOR_TODAY].red   = 65535;
-	week_view->colors[E_WEEK_VIEW_COLOR_TODAY].green = 0;
-	week_view->colors[E_WEEK_VIEW_COLOR_TODAY].blue  = 0;
-
-	nfailed = gdk_colormap_alloc_colors (colormap, week_view->colors,
-					     E_WEEK_VIEW_COLOR_LAST, FALSE,
-					     TRUE, success);
-	if (nfailed)
-		g_warning ("Failed to allocate all colors");
-
+	e_week_view_set_colors(week_view, widget);
+	
 	gdk_gc_set_colormap (week_view->main_gc, colormap);
 
 	/* Create the pixmaps. */
@@ -812,6 +765,21 @@
 	week_view->timezone_icon = e_icon_factory_get_icon ("stock_timezone", E_ICON_SIZE_MENU);
 }
 
+static void
+e_week_view_set_colors(EWeekView *week_view, GtkWidget *widget)
+{
+	week_view->colors[E_WEEK_VIEW_COLOR_EVEN_MONTHS] = widget->style->base[GTK_STATE_INSENSITIVE];
+	week_view->colors[E_WEEK_VIEW_COLOR_ODD_MONTHS] = widget->style->base[GTK_STATE_NORMAL];
+	week_view->colors[E_WEEK_VIEW_COLOR_EVENT_BACKGROUND] = widget->style->base[GTK_STATE_NORMAL];
+	week_view->colors[E_WEEK_VIEW_COLOR_EVENT_BORDER] = widget->style->dark[GTK_STATE_NORMAL];
+	week_view->colors[E_WEEK_VIEW_COLOR_EVENT_TEXT] = widget->style->text[GTK_STATE_NORMAL];
+	week_view->colors[E_WEEK_VIEW_COLOR_GRID] = widget->style->dark[GTK_STATE_NORMAL];
+	week_view->colors[E_WEEK_VIEW_COLOR_SELECTED] = widget->style->base[GTK_STATE_SELECTED];
+	week_view->colors[E_WEEK_VIEW_COLOR_SELECTED_UNFOCUSSED] = widget->style->bg[GTK_STATE_SELECTED];
+	week_view->colors[E_WEEK_VIEW_COLOR_DATES] = widget->style->text[GTK_STATE_NORMAL];
+	week_view->colors[E_WEEK_VIEW_COLOR_DATES_SELECTED] = widget->style->text[GTK_STATE_SELECTED];
+	week_view->colors[E_WEEK_VIEW_COLOR_TODAY] = widget->style->base[GTK_STATE_SELECTED];
+}
 
 static void
 e_week_view_unrealize (GtkWidget *widget)
@@ -880,12 +848,14 @@
 	GtkStyle *style;
 	gint day, day_width, max_day_width, max_abbr_day_width;
 	gint month, month_width, max_month_width, max_abbr_month_width;
+	gint span_num;
 	GDate date;
 	gchar buffer[128];
 	PangoFontDescription *font_desc;
 	PangoContext *pango_context;
 	PangoFontMetrics *font_metrics;
 	PangoLayout *layout;
+	EWeekViewEventSpan *span;
 
 	if (GTK_WIDGET_CLASS (e_week_view_parent_class)->style_set)
 		(*GTK_WIDGET_CLASS (e_week_view_parent_class)->style_set)(widget, previous_style);
@@ -893,6 +863,20 @@
 	week_view = E_WEEK_VIEW (widget);
 	style = gtk_widget_get_style (widget);
 
+	e_week_view_set_colors(week_view, widget);
+	if (week_view->spans) {
+		for (span_num = 0; span_num < week_view->spans->len;
+				span_num++) {
+			span = &g_array_index (week_view->spans,
+					EWeekViewEventSpan, span_num);
+			if (span->text_item){
+				gnome_canvas_item_set (span->text_item,
+						"fill_color_gdk", &widget->style->text[GTK_STATE_NORMAL],
+						NULL);
+			}
+		}
+	}
+
 	/* Set up Pango prerequisites */
 	font_desc = style->font_desc;
 	pango_context = gtk_widget_get_pango_context (widget);
@@ -2687,7 +2671,9 @@
 	/* Create the text item if necessary. */
 	if (!span->text_item) {
 		ECalComponentText text;
+		GtkWidget *widget;
 
+		widget = (GtkWidget *)week_view;
 		e_cal_component_get_summary (comp, &text);
 		span->text_item =
 			gnome_canvas_item_new (GNOME_CANVAS_GROUP (GNOME_CANVAS (week_view->main_canvas)->root),
@@ -2698,7 +2684,7 @@
 					       "editable", TRUE,
 					       "text", text.value ? text.value : "",
 					       "use_ellipsis", TRUE,
-					       "fill_color_rgba", GNOME_CANVAS_COLOR(0, 0, 0),
+					       "fill_color_gdk", &widget->style->text[GTK_STATE_NORMAL],
 					       "im_context", E_CANVAS (week_view->main_canvas)->im_context,
 					       NULL);
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]