From fd7b20eeab5c10546842841e3c316332c0a0359a Mon Sep 17 00:00:00 2001 From: Christopher James Lahey Date: Mon, 6 Mar 2000 07:36:38 +0000 Subject: Draw selected row. 2000-03-06 Christopher James Lahey * e-cell-text.c: Draw selected row. svn path=/trunk/; revision=2070 --- widgets/table/e-cell-text.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'widgets/table') diff --git a/widgets/table/e-cell-text.c b/widgets/table/e-cell-text.c index 37213e3904..191ac86023 100644 --- a/widgets/table/e-cell-text.c +++ b/widgets/table/e-cell-text.c @@ -389,6 +389,7 @@ ect_draw (ECellView *ecell_view, GdkDrawable *drawable, CellEdit *edit = text_view->edit; gboolean edit_display = FALSE; ECellTextLineBreaks *linebreaks; + GdkColor *background, *foreground; if (edit){ @@ -414,10 +415,18 @@ ect_draw (ECellView *ecell_view, GdkDrawable *drawable, gdk_gc_set_clip_rectangle (fg_gc, &rect); clip_rect = ▭ - gdk_gc_set_foreground (text_view->gc, &canvas->style->base [GTK_STATE_NORMAL]); + + if (selected){ + background = &canvas->style->bg [GTK_STATE_SELECTED]; + foreground = &canvas->style->text [GTK_STATE_SELECTED]; + } else { + background = &canvas->style->base [GTK_STATE_NORMAL]; + foreground = &canvas->style->text [GTK_STATE_NORMAL]; + } + gdk_gc_set_foreground (text_view->gc, background); gdk_draw_rectangle (drawable, text_view->gc, TRUE, rect.x, rect.y, rect.width, rect.height); - gdk_gc_set_foreground (text_view->gc, &canvas->style->text [GTK_STATE_NORMAL]); + gdk_gc_set_foreground (text_view->gc, foreground); x1 += 4; y1 += 1; @@ -551,6 +560,7 @@ ect_draw (ECellView *ecell_view, GdkDrawable *drawable, ypos = get_line_ypos(&cell, lines); ypos += font->ascent; + for (i = 0; i < linebreaks->num_lines; i++) { xpos = get_line_xpos (&cell, lines); if ( ect->use_ellipsis && lines->ellipsis_length < lines->length) { -- cgit v1.2.3