From 04601125b5bf376e65da35c46cf77e690e7c1132 Mon Sep 17 00:00:00 2001 From: Chris Toshok Date: Thu, 3 Apr 2003 01:31:49 +0000 Subject: add NONE:OBJECT 2003-04-02 Chris Toshok * gui/widgets/e-addressbook-marshal.list: add NONE:OBJECT * gui/widgets/e-minicard.c (e_minicard_class_init): add style_set signal. (e_minicard_style_set): just call set_selected with the currently selected flag, so we recolor properly. * gui/widgets/e-minicard.h (struct _EMinicardClass): add style_set signal. svn path=/trunk/; revision=20651 --- addressbook/gui/widgets/e-addressbook-marshal.list | 1 + addressbook/gui/widgets/e-minicard.c | 20 ++++++++++++++++++++ addressbook/gui/widgets/e-minicard.h | 2 ++ 3 files changed, 23 insertions(+) (limited to 'addressbook/gui') diff --git a/addressbook/gui/widgets/e-addressbook-marshal.list b/addressbook/gui/widgets/e-addressbook-marshal.list index 8f97e48e86..2b34707dbb 100644 --- a/addressbook/gui/widgets/e-addressbook-marshal.list +++ b/addressbook/gui/widgets/e-addressbook-marshal.list @@ -2,6 +2,7 @@ INT:POINTER NONE:NONE NONE:BOOL NONE:POINTER +NONE:OBJECT NONE:ENUM NONE:INT,INT NONE:INT diff --git a/addressbook/gui/widgets/e-minicard.c b/addressbook/gui/widgets/e-minicard.c index 8bebb4cdb0..15ecbf05f3 100644 --- a/addressbook/gui/widgets/e-minicard.c +++ b/addressbook/gui/widgets/e-minicard.c @@ -52,6 +52,7 @@ static gboolean e_minicard_event (GnomeCanvasItem *item, GdkEvent *event); static void e_minicard_realize (GnomeCanvasItem *item); static void e_minicard_unrealize (GnomeCanvasItem *item); static void e_minicard_reflow ( GnomeCanvasItem *item, int flags ); +static void e_minicard_style_set (EMinicard *minicard, GtkStyle *previous_style); static void e_minicard_resize_children( EMinicard *e_minicard ); static void remodel( EMinicard *e_minicard ); @@ -95,6 +96,7 @@ enum { enum { SELECTED, DRAG_BEGIN, + STYLE_SET, LAST_SIGNAL }; @@ -135,6 +137,8 @@ e_minicard_class_init (EMinicardClass *klass) object_class->dispose = e_minicard_dispose; object_class->finalize = e_minicard_finalize; + klass->style_set = e_minicard_style_set; + parent_class = gtk_type_class (gnome_canvas_group_get_type ()); g_object_class_install_property (object_class, PROP_WIDTH, @@ -206,6 +210,16 @@ e_minicard_class_init (EMinicardClass *klass) e_addressbook_marshal_INT__POINTER, G_TYPE_INT, 1, G_TYPE_POINTER); + e_minicard_signals [STYLE_SET] = + g_signal_new ("style_set", + G_TYPE_FROM_CLASS (object_class), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (EMinicardClass, style_set), + NULL, NULL, + e_addressbook_marshal_VOID__OBJECT, + G_TYPE_NONE, 1, + GTK_TYPE_STYLE); + /* GnomeCanvasItem method overrides */ item_class->realize = e_minicard_realize; item_class->unrealize = e_minicard_unrealize; @@ -431,6 +445,12 @@ e_minicard_finalize (GObject *object) (* G_OBJECT_CLASS (parent_class)->finalize) (object); } +static void +e_minicard_style_set (EMinicard *minicard, GtkStyle *previous_style) +{ + set_selected (minicard, minicard->selected); +} + static void e_minicard_realize (GnomeCanvasItem *item) { diff --git a/addressbook/gui/widgets/e-minicard.h b/addressbook/gui/widgets/e-minicard.h index 37d5407ad1..ac0f82e46c 100644 --- a/addressbook/gui/widgets/e-minicard.h +++ b/addressbook/gui/widgets/e-minicard.h @@ -104,6 +104,8 @@ struct _EMinicardClass gint (* selected) (EMinicard *minicard, GdkEvent *event); gint (* drag_begin) (EMinicard *minicard, GdkEvent *event); + + void (* style_set) (EMinicard *minicard, GtkStyle *previous_style); }; -- cgit