From a30113eebca968c19094643505932a3558e08704 Mon Sep 17 00:00:00 2001 From: Christopher James Lahey Date: Tue, 22 Aug 2000 10:03:36 +0000 Subject: Moved drawing of the cell backgrounds from ECell into ETableItem. 2000-08-22 Christopher James Lahey * e-cell-text.c, e-cell-toggle.c, e-cell-tree.c, e-table-item.c: Moved drawing of the cell backgrounds from ECell into ETableItem. * e-tree-model.c: Include stdlib.c. svn path=/trunk/; revision=4915 --- widgets/table/e-table-item.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'widgets/table/e-table-item.c') diff --git a/widgets/table/e-table-item.c b/widgets/table/e-table-item.c index b394669110..0f70861f1e 100644 --- a/widgets/table/e-table-item.c +++ b/widgets/table/e-table-item.c @@ -1016,8 +1016,7 @@ eti_realize (GnomeCanvasItem *item) */ window = canvas_widget->window; - eti->fill_gc = canvas_widget->style->white_gc; - gdk_gc_ref (canvas_widget->style->white_gc); + eti->fill_gc = gdk_gc_new (window); eti->grid_gc = gdk_gc_new (window); #if 0 @@ -1084,6 +1083,8 @@ eti_draw (GnomeCanvasItem *item, GdkDrawable *drawable, int x, int y, int width, gboolean f_found; double i2c [6]; ArtPoint eti_base, eti_base_item; + GtkWidget *canvas = GTK_WIDGET(item->canvas); + GdkColor *background; /* * Clear the background @@ -1201,6 +1202,19 @@ eti_draw (GnomeCanvasItem *item, GdkDrawable *drawable, int x, int y, int width, break; } + if (selected){ + background = &canvas->style->bg [GTK_STATE_SELECTED]; + } else { + if (row % 2) + background = &canvas->style->base [GTK_STATE_NORMAL]; + else + background = &canvas->style->base [GTK_STATE_SELECTED]; + } + + gdk_gc_set_foreground (eti->fill_gc, background); + gdk_draw_rectangle (drawable, eti->fill_gc, TRUE, + xd, yd, ecol->width, height); + e_cell_draw (ecell_view, drawable, ecol->col_idx, col, row, col_selected, xd, yd, xd + ecol->width, yd + height); -- cgit