diff options
author | Chris Toshok <toshok@ximian.com> | 2003-04-08 12:44:58 +0800 |
---|---|---|
committer | Chris Toshok <toshok@src.gnome.org> | 2003-04-08 12:44:58 +0800 |
commit | c5bab4bb067169afa5ef9ae2c0e2926f9c67c6a5 (patch) | |
tree | 4eed594a35869c0ec4cf5094cbb689c8cb40455e /addressbook/gui/widgets/e-minicard-view-widget.c | |
parent | fc5fc4dcf006ff720c73620c233a3655d479c05a (diff) | |
download | gsoc2013-evolution-c5bab4bb067169afa5ef9ae2c0e2926f9c67c6a5.tar gsoc2013-evolution-c5bab4bb067169afa5ef9ae2c0e2926f9c67c6a5.tar.gz gsoc2013-evolution-c5bab4bb067169afa5ef9ae2c0e2926f9c67c6a5.tar.bz2 gsoc2013-evolution-c5bab4bb067169afa5ef9ae2c0e2926f9c67c6a5.tar.lz gsoc2013-evolution-c5bab4bb067169afa5ef9ae2c0e2926f9c67c6a5.tar.xz gsoc2013-evolution-c5bab4bb067169afa5ef9ae2c0e2926f9c67c6a5.tar.zst gsoc2013-evolution-c5bab4bb067169afa5ef9ae2c0e2926f9c67c6a5.zip |
[ fixes #7103 ] init style_set. and add the signal.
2003-04-07 Chris Toshok <toshok@ximian.com>
[ fixes #7103 ]
* gui/widgets/e-minicard-label.c (e_minicard_label_class_init):
init style_set. and add the signal.
(e_minicard_label_realize): include e_minicard_label_construct's
code here, and call set_colors after we create the sub-items.
(e_minicard_label_unrealize): indent, and remove dead code.
(e_minicard_label_event): indent, and call set_colors instead of
setting the colors manually.
(set_colors): new function, set our colors based on the current
style.
(e_minicard_label_style_set): new function, just call set_colors.
(e_minicard_label_new): e_minicard_label_construct doesn't exist
anymore.
* gui/widgets/e-minicard-label.h (struct _EMinicardLabelClass):
add style_set signal.
* gui/widgets/e-minicard.c (set_selected): little tweaks in the
coloring.
(e_minicard_unrealize): reindent, and remove some unused code.
* gui/widgets/e-minicard-view-widget.h (struct
_EMinicardViewWidget): add background.
* gui/widgets/e-minicard-view-widget.c
(e_minicard_view_widget_class_init): init
widget_class->style_class.
(e_minicard_view_widget_style_set): new function, just set the
background's fill_color_gdk to base[GTK_STATE_NORMAL].
(e_minicard_view_widget_realize): store off the background canvas
item so we can set the color later.
svn path=/trunk/; revision=20742
Diffstat (limited to 'addressbook/gui/widgets/e-minicard-view-widget.c')
-rw-r--r-- | addressbook/gui/widgets/e-minicard-view-widget.c | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/addressbook/gui/widgets/e-minicard-view-widget.c b/addressbook/gui/widgets/e-minicard-view-widget.c index 2ba6bc6852..b4681e1b4b 100644 --- a/addressbook/gui/widgets/e-minicard-view-widget.c +++ b/addressbook/gui/widgets/e-minicard-view-widget.c @@ -36,6 +36,7 @@ static void e_minicard_view_widget_get_property (GObject *object, guint prop_id static void e_minicard_view_widget_dispose (GObject *object); static void e_minicard_view_widget_reflow (ECanvas *canvas); static void e_minicard_view_widget_size_allocate (GtkWidget *widget, GtkAllocation *allocation); +static void e_minicard_view_widget_style_set (GtkWidget *widget, GtkStyle *previous_style); static void e_minicard_view_widget_realize (GtkWidget *widget); static ECanvasClass *parent_class = NULL; @@ -154,6 +155,7 @@ e_minicard_view_widget_class_init (EMinicardViewWidgetClass *klass) e_addressbook_marshal_INT__POINTER, G_TYPE_INT, 1, G_TYPE_POINTER); + widget_class->style_set = e_minicard_view_widget_style_set; widget_class->realize = e_minicard_view_widget_realize; widget_class->size_allocate = e_minicard_view_widget_size_allocate; @@ -316,14 +318,29 @@ right_click (EMinicardView *view, GdkEvent *event, EMinicardViewWidget *widget) } static void +e_minicard_view_widget_style_set (GtkWidget *widget, GtkStyle *previous_style) +{ + EMinicardViewWidget *view = E_MINICARD_VIEW_WIDGET(widget); + + if (view->background) + gnome_canvas_item_set (view->background, + "fill_color_gdk", &widget->style->base[GTK_STATE_NORMAL], + NULL ); + + if (GTK_WIDGET_CLASS(parent_class)->style_set) + GTK_WIDGET_CLASS(parent_class)->style_set (widget, previous_style); +} + +static void e_minicard_view_widget_realize (GtkWidget *widget) { EMinicardViewWidget *view = E_MINICARD_VIEW_WIDGET(widget); + GtkStyle *style = gtk_widget_get_style (widget); - gnome_canvas_item_new(gnome_canvas_root( GNOME_CANVAS(view) ), - e_canvas_background_get_type(), - "fill_color", "white", - NULL ); + view->background = gnome_canvas_item_new(gnome_canvas_root( GNOME_CANVAS(view) ), + e_canvas_background_get_type(), + "fill_color_gdk", &style->base[GTK_STATE_NORMAL], + NULL ); view->emv = gnome_canvas_item_new( gnome_canvas_root( GNOME_CANVAS(view) ), |