diff options
Diffstat (limited to 'widgets')
-rw-r--r-- | widgets/misc/e-canvas-background.c | 26 | ||||
-rw-r--r-- | widgets/misc/e-canvas-background.h | 1 |
2 files changed, 27 insertions, 0 deletions
diff --git a/widgets/misc/e-canvas-background.c b/widgets/misc/e-canvas-background.c index 0e57feff4e..26d9d37de2 100644 --- a/widgets/misc/e-canvas-background.c +++ b/widgets/misc/e-canvas-background.c @@ -56,6 +56,13 @@ struct _ECanvasBackgroundPrivate { 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 @@ ecb_point (GnomeCanvasItem *item, double x, double y, int cx, int cy, } static void +ecb_style_set (ECanvasBackground *ecb, GtkStyle *previous_style) +{ + GnomeCanvasItem *item = GNOME_CANVAS_ITEM (ecb); + gdk_gc_set_foreground (ecb->priv->gc, >K_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 @@ ecb_class_init (GObjectClass *object_class) 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 @@ ecb_class_init (GObjectClass *object_class) _( "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, diff --git a/widgets/misc/e-canvas-background.h b/widgets/misc/e-canvas-background.h index 4a8e3294fb..eb3eecbd00 100644 --- a/widgets/misc/e-canvas-background.h +++ b/widgets/misc/e-canvas-background.h @@ -60,6 +60,7 @@ struct _ECanvasBackground { struct _ECanvasBackgroundClass { GnomeCanvasItemClass parent_class; + void (*style_set) (ECanvasBackground *eti, GtkStyle *previous_style); }; |