From e7a10a24388a2b0713c83305a189640adf2f2c94 Mon Sep 17 00:00:00 2001 From: Larry Ewing Date: Wed, 16 Aug 2000 05:16:23 +0000 Subject: use style colors for the selected state. This doesn't properly redraw the 2000-08-15 Larry Ewing * gui/minicard/e-minicard.c (e_minicard_event): use style colors for the selected state. This doesn't properly redraw the minicard when there is a style_change event, that is next. (e_minicard_realize): use style colors. svn path=/trunk/; revision=4851 --- addressbook/gui/minicard/e-minicard.c | 20 +++++++++++++------- addressbook/gui/widgets/e-minicard.c | 20 +++++++++++++------- 2 files changed, 26 insertions(+), 14 deletions(-) (limited to 'addressbook/gui') diff --git a/addressbook/gui/minicard/e-minicard.c b/addressbook/gui/minicard/e-minicard.c index 29bc178811..e9bb85c89d 100644 --- a/addressbook/gui/minicard/e-minicard.c +++ b/addressbook/gui/minicard/e-minicard.c @@ -249,9 +249,11 @@ e_minicard_realize (GnomeCanvasItem *item) { EMinicard *e_minicard; GnomeCanvasGroup *group; + GtkWidget *canvas; e_minicard = E_MINICARD (item); group = GNOME_CANVAS_GROUP( item ); + canvas = GTK_WIDGET (GNOME_CANVAS_ITEM (item)->canvas); if (GNOME_CANVAS_ITEM_CLASS(parent_class)->realize) (* GNOME_CANVAS_ITEM_CLASS(parent_class)->realize) (item); @@ -273,7 +275,7 @@ e_minicard_realize (GnomeCanvasItem *item) "y1", (double) 2, "x2", (double) e_minicard->width - 3, "y2", (double) e_minicard->height - 3, - "fill_color", "grey70", + "fill_color_gdk", &canvas->style->bg[GTK_STATE_NORMAL], NULL ); e_minicard->header_text = @@ -284,7 +286,7 @@ e_minicard_realize (GnomeCanvasItem *item) "clip", TRUE, "use_ellipsis", TRUE, "font", "lucidasans-bold-10", - "fill_color", "black", + "fill_color_gdk", &canvas->style->fg[GTK_STATE_NORMAL], "text", "", NULL ); e_canvas_item_move_absolute(e_minicard->header_text, 6, 6); @@ -399,8 +401,10 @@ static gboolean e_minicard_event (GnomeCanvasItem *item, GdkEvent *event) { EMinicard *e_minicard; + GtkWidget *canvas; e_minicard = E_MINICARD (item); + canvas = GTK_WIDGET (GNOME_CANVAS_ITEM (item)->canvas); switch( event->type ) { case GDK_FOCUS_CHANGE: @@ -408,13 +412,13 @@ e_minicard_event (GnomeCanvasItem *item, GdkEvent *event) GdkEventFocus *focus_event = (GdkEventFocus *) event; if ( focus_event->in ) { gnome_canvas_item_set( e_minicard->rect, - "outline_color", "grey50", + "outline_color_gdk", &canvas->style->bg[GTK_STATE_NORMAL], NULL ); gnome_canvas_item_set( e_minicard->header_rect, - "fill_color", "darkblue", + "fill_color_gdk", &canvas->style->bg[GTK_STATE_SELECTED], NULL ); gnome_canvas_item_set( e_minicard->header_text, - "fill_color", "white", + "fill_color_gdk", &canvas->style->text[GTK_STATE_SELECTED], NULL ); e_minicard->has_focus = TRUE; } else { @@ -446,10 +450,12 @@ e_minicard_event (GnomeCanvasItem *item, GdkEvent *event) "outline_color", NULL, NULL ); gnome_canvas_item_set( e_minicard->header_rect, - "fill_color", "grey70", + "fill_color_gdk", + &canvas->style->bg[GTK_STATE_NORMAL], NULL ); gnome_canvas_item_set( e_minicard->header_text, - "fill_color", "black", + "fill_color_gdk", + &canvas->style->fg[GTK_STATE_NORMAL], NULL ); e_minicard->has_focus = FALSE; } diff --git a/addressbook/gui/widgets/e-minicard.c b/addressbook/gui/widgets/e-minicard.c index 29bc178811..e9bb85c89d 100644 --- a/addressbook/gui/widgets/e-minicard.c +++ b/addressbook/gui/widgets/e-minicard.c @@ -249,9 +249,11 @@ e_minicard_realize (GnomeCanvasItem *item) { EMinicard *e_minicard; GnomeCanvasGroup *group; + GtkWidget *canvas; e_minicard = E_MINICARD (item); group = GNOME_CANVAS_GROUP( item ); + canvas = GTK_WIDGET (GNOME_CANVAS_ITEM (item)->canvas); if (GNOME_CANVAS_ITEM_CLASS(parent_class)->realize) (* GNOME_CANVAS_ITEM_CLASS(parent_class)->realize) (item); @@ -273,7 +275,7 @@ e_minicard_realize (GnomeCanvasItem *item) "y1", (double) 2, "x2", (double) e_minicard->width - 3, "y2", (double) e_minicard->height - 3, - "fill_color", "grey70", + "fill_color_gdk", &canvas->style->bg[GTK_STATE_NORMAL], NULL ); e_minicard->header_text = @@ -284,7 +286,7 @@ e_minicard_realize (GnomeCanvasItem *item) "clip", TRUE, "use_ellipsis", TRUE, "font", "lucidasans-bold-10", - "fill_color", "black", + "fill_color_gdk", &canvas->style->fg[GTK_STATE_NORMAL], "text", "", NULL ); e_canvas_item_move_absolute(e_minicard->header_text, 6, 6); @@ -399,8 +401,10 @@ static gboolean e_minicard_event (GnomeCanvasItem *item, GdkEvent *event) { EMinicard *e_minicard; + GtkWidget *canvas; e_minicard = E_MINICARD (item); + canvas = GTK_WIDGET (GNOME_CANVAS_ITEM (item)->canvas); switch( event->type ) { case GDK_FOCUS_CHANGE: @@ -408,13 +412,13 @@ e_minicard_event (GnomeCanvasItem *item, GdkEvent *event) GdkEventFocus *focus_event = (GdkEventFocus *) event; if ( focus_event->in ) { gnome_canvas_item_set( e_minicard->rect, - "outline_color", "grey50", + "outline_color_gdk", &canvas->style->bg[GTK_STATE_NORMAL], NULL ); gnome_canvas_item_set( e_minicard->header_rect, - "fill_color", "darkblue", + "fill_color_gdk", &canvas->style->bg[GTK_STATE_SELECTED], NULL ); gnome_canvas_item_set( e_minicard->header_text, - "fill_color", "white", + "fill_color_gdk", &canvas->style->text[GTK_STATE_SELECTED], NULL ); e_minicard->has_focus = TRUE; } else { @@ -446,10 +450,12 @@ e_minicard_event (GnomeCanvasItem *item, GdkEvent *event) "outline_color", NULL, NULL ); gnome_canvas_item_set( e_minicard->header_rect, - "fill_color", "grey70", + "fill_color_gdk", + &canvas->style->bg[GTK_STATE_NORMAL], NULL ); gnome_canvas_item_set( e_minicard->header_text, - "fill_color", "black", + "fill_color_gdk", + &canvas->style->fg[GTK_STATE_NORMAL], NULL ); e_minicard->has_focus = FALSE; } -- cgit