[evolution-patches] patch to fix 301888



Hi, JP

The patch is for #301888. Please help me to review it.
Thank you very much.

Regards,
Li
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/gal/ChangeLog,v
retrieving revision 1.925
diff -u -r1.925 ChangeLog
--- ChangeLog	22 Apr 2005 08:04:03 -0000	1.925
+++ ChangeLog	25 Apr 2005 09:03:20 -0000
@@ -1,3 +1,12 @@
+2005-04-25  Li Yuan  <li yuan sun com>
+
+	* gal/widgets/e-canvas-background.c: (ecb_style_set),
+	(ecb_class_init):add a signal "style_set" to support theme.
+	* gal/widgets/e-canvas-background.h:
+	ditto.
+
+	Fixes #301888
+
 2005-04-21  Mengjie Yu  <meng-jie yu sun com>
 
 	* gal/widgets/e-reflow.c: (do_adjustment), (cursor_changed),
Index: gal/widgets/e-canvas-background.c
===================================================================
RCS file: /cvs/gnome/gal/gal/widgets/e-canvas-background.c,v
retrieving revision 1.8
diff -u -r1.8 e-canvas-background.c
--- gal/widgets/e-canvas-background.c	8 Apr 2003 04:34:34 -0000	1.8
+++ gal/widgets/e-canvas-background.c	25 Apr 2005 09:03:24 -0000
@@ -56,6 +56,13 @@
 static GnomeCanvasItemClass *parent_class;
 
 enum {
+	STYLE_SET,
+	LAST_SIGNAL
+};
+
+static guint ecb_signals [LAST_SIGNAL] = { 0, };
+
+enum {
 	PROP_0,
 	PROP_FILL_COLOR,
 	PROP_FILL_COLOR_GDK,
@@ -415,9 +422,18 @@
 }
 
 static void
+ecb_style_set (ECanvasBackground *ecb, GtkStyle *previous_style)
+{
+	GnomeCanvasItem *item = GNOME_CANVAS_ITEM (ecb);
+	gdk_gc_set_foreground (ecb->priv->gc, &GTK_WIDGET(item->canvas)->style->base[GTK_STATE_NORMAL]);
+	gnome_canvas_item_request_update (GNOME_CANVAS_ITEM (ecb));
+}
+
+static void
 ecb_class_init (GObjectClass *object_class)
 {
 	GnomeCanvasItemClass *item_class = (GnomeCanvasItemClass *) object_class;
+	ECanvasBackgroundClass *ecb_class = (ECanvasBackgroundClass *) object_class;
 	
 	parent_class                = g_type_class_ref (PARENT_OBJECT_TYPE);
 	
@@ -431,6 +447,8 @@
 	item_class->draw            = ecb_draw;
 	item_class->point           = ecb_point;
 
+	ecb_class->style_set	    = ecb_style_set;
+
 	g_object_class_install_property (object_class, PROP_FILL_COLOR,
 					 g_param_spec_string ("fill_color",
 							      _( "Fill color" ),
@@ -486,6 +504,14 @@
 							      _( "Y2" ),
 							      0.0, G_MAXDOUBLE, 0.0,
 							      G_PARAM_READWRITE));
+	ecb_signals [STYLE_SET] =
+		g_signal_new ("style_set",
+			      G_OBJECT_CLASS_TYPE (object_class),
+			      G_SIGNAL_RUN_LAST,
+			      G_STRUCT_OFFSET (ECanvasBackgroundClass, style_set),
+			      NULL, NULL,
+			      e_marshal_NONE__OBJECT,
+			      G_TYPE_NONE, 1, GTK_TYPE_STYLE);
 }
 
 E_MAKE_TYPE (e_canvas_background,
Index: gal/widgets/e-canvas-background.h
===================================================================
RCS file: /cvs/gnome/gal/gal/widgets/e-canvas-background.h,v
retrieving revision 1.4
diff -u -r1.4 e-canvas-background.h
--- gal/widgets/e-canvas-background.h	16 Nov 2002 23:42:17 -0000	1.4
+++ gal/widgets/e-canvas-background.h	25 Apr 2005 09:03:24 -0000
@@ -60,6 +60,7 @@
 
 struct _ECanvasBackgroundClass {
 	GnomeCanvasItemClass parent_class;
+	void        (*style_set)        (ECanvasBackground *eti, GtkStyle *previous_style);
 };
 
 


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