aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristopher James Lahey <clahey@helixcode.com>2000-03-06 15:36:38 +0800
committerChris Lahey <clahey@src.gnome.org>2000-03-06 15:36:38 +0800
commitfd7b20eeab5c10546842841e3c316332c0a0359a (patch)
treee7b427d185bdb6e5c7f5abae90881fe00f00cf69
parentdf08e926e4ac496e75974620162e59cf323f623a (diff)
downloadgsoc2013-evolution-fd7b20eeab5c10546842841e3c316332c0a0359a.tar
gsoc2013-evolution-fd7b20eeab5c10546842841e3c316332c0a0359a.tar.gz
gsoc2013-evolution-fd7b20eeab5c10546842841e3c316332c0a0359a.tar.bz2
gsoc2013-evolution-fd7b20eeab5c10546842841e3c316332c0a0359a.tar.lz
gsoc2013-evolution-fd7b20eeab5c10546842841e3c316332c0a0359a.tar.xz
gsoc2013-evolution-fd7b20eeab5c10546842841e3c316332c0a0359a.tar.zst
gsoc2013-evolution-fd7b20eeab5c10546842841e3c316332c0a0359a.zip
Draw selected row.
2000-03-06 Christopher James Lahey <clahey@helixcode.com> * e-cell-text.c: Draw selected row. svn path=/trunk/; revision=2070
-rw-r--r--widgets/e-table/ChangeLog4
-rw-r--r--widgets/e-table/e-cell-text.c14
-rw-r--r--widgets/table/e-cell-text.c14
3 files changed, 28 insertions, 4 deletions
diff --git a/widgets/e-table/ChangeLog b/widgets/e-table/ChangeLog
index 705432b19e..2239817da5 100644
--- a/widgets/e-table/ChangeLog
+++ b/widgets/e-table/ChangeLog
@@ -1,5 +1,9 @@
2000-03-06 Christopher James Lahey <clahey@helixcode.com>
+ * e-cell-text.c: Draw selected row.
+
+2000-03-06 Christopher James Lahey <clahey@helixcode.com>
+
* e-table.c, e-table.h: Add a "row_selection" signal.
* test-table.c: Test the new "row_selection" signal.
diff --git a/widgets/e-table/e-cell-text.c b/widgets/e-table/e-cell-text.c
index 37213e3904..191ac86023 100644
--- a/widgets/e-table/e-cell-text.c
+++ b/widgets/e-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 = &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) {
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 = &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) {