aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--widgets/table/e-cell-text.c5
-rw-r--r--widgets/table/e-cell.h2
-rw-r--r--widgets/table/e-table-item.c6
-rw-r--r--widgets/table/e-table.c6
4 files changed, 17 insertions, 2 deletions
diff --git a/widgets/table/e-cell-text.c b/widgets/table/e-cell-text.c
index 4a4b90ce08..0fe721f0ec 100644
--- a/widgets/table/e-cell-text.c
+++ b/widgets/table/e-cell-text.c
@@ -489,7 +489,10 @@ ect_draw (ECellView *ecell_view, GdkDrawable *drawable,
clip_rect = ▭
if (selected){
- foreground = &canvas->style->text [GTK_STATE_SELECTED];
+ if (flags & E_CELL_FOCUSED)
+ foreground = &canvas->style->text [GTK_STATE_SELECTED];
+ else
+ foreground = &canvas->style->text [GTK_STATE_ACTIVE];
} else {
foreground = &canvas->style->text [GTK_STATE_NORMAL];
}
diff --git a/widgets/table/e-cell.h b/widgets/table/e-cell.h
index ecafa582f1..3ff346d8a2 100644
--- a/widgets/table/e-cell.h
+++ b/widgets/table/e-cell.h
@@ -28,6 +28,8 @@ enum _ECellFlags {
E_CELL_ALIGN_LEFT = 1 << 1,
E_CELL_ALIGN_RIGHT = 1 << 2,
+
+ E_CELL_FOCUSED = 1 << 3,
};
struct _ECell {
diff --git a/widgets/table/e-table-item.c b/widgets/table/e-table-item.c
index 4a48dd7e81..20259b0ed7 100644
--- a/widgets/table/e-table-item.c
+++ b/widgets/table/e-table-item.c
@@ -1228,7 +1228,10 @@ eti_draw (GnomeCanvasItem *item, GdkDrawable *drawable, int x, int y, int width,
}
if (col_selected){
- background = &canvas->style->bg [GTK_STATE_SELECTED];
+ if (GTK_WIDGET_HAS_FOCUS(canvas))
+ background = &canvas->style->bg [GTK_STATE_SELECTED];
+ else
+ background = &canvas->style->bg [GTK_STATE_ACTIVE];
} else {
#if 0
if (row % 2)
@@ -1245,6 +1248,7 @@ eti_draw (GnomeCanvasItem *item, GdkDrawable *drawable, int x, int y, int width,
xd, yd, ecol->width, height);
flags = col_selected ? E_CELL_SELECTED : 0;
+ flags |= GTK_WIDGET_HAS_FOCUS(canvas) ? E_CELL_FOCUSED : 0;
switch (ecol->justification) {
case GTK_JUSTIFY_LEFT:
flags |= E_CELL_JUSTIFY_LEFT;
diff --git a/widgets/table/e-table.c b/widgets/table/e-table.c
index 006909dac6..2abd24328a 100644
--- a/widgets/table/e-table.c
+++ b/widgets/table/e-table.c
@@ -523,6 +523,12 @@ e_table_setup_table (ETable *e_table, ETableHeader *full_header, ETableHeader *h
gtk_signal_connect (
GTK_OBJECT (e_table->table_canvas), "size_allocate",
GTK_SIGNAL_FUNC (table_canvas_size_allocate), e_table);
+ gtk_signal_connect (
+ GTK_OBJECT (e_table->table_canvas), "focus_in_event",
+ GTK_SIGNAL_FUNC (gtk_widget_queue_draw), e_table);
+ gtk_signal_connect (
+ GTK_OBJECT (e_table->table_canvas), "focus_out_event",
+ GTK_SIGNAL_FUNC (gtk_widget_queue_draw), e_table);
gtk_signal_connect (
GTK_OBJECT (e_table), "drag_begin",