diff options
author | Christopher James Lahey <clahey@helixcode.com> | 2000-08-22 18:03:36 +0800 |
---|---|---|
committer | Chris Lahey <clahey@src.gnome.org> | 2000-08-22 18:03:36 +0800 |
commit | a30113eebca968c19094643505932a3558e08704 (patch) | |
tree | a5ddd2d229498a9a5a81757ce0962ab4a4fe5c35 /widgets/table/e-table-item.c | |
parent | 9943237d5f7096921574ed2a5e969aeec6682e49 (diff) | |
download | gsoc2013-evolution-a30113eebca968c19094643505932a3558e08704.tar.gz gsoc2013-evolution-a30113eebca968c19094643505932a3558e08704.tar.zst gsoc2013-evolution-a30113eebca968c19094643505932a3558e08704.zip |
Moved drawing of the cell backgrounds from ECell into ETableItem.
2000-08-22 Christopher James Lahey <clahey@helixcode.com>
* 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
Diffstat (limited to 'widgets/table/e-table-item.c')
-rw-r--r-- | widgets/table/e-table-item.c | 18 |
1 files changed, 16 insertions, 2 deletions
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); |