Make text a different color if !(flags & E_CELL_FOCUSED).

2000-10-18  Christopher James Lahey  <clahey@helixcode.com>

	* e-cell-text.c: Make text a different color if !(flags &
	E_CELL_FOCUSED).

	* e-cell.h: Added E_CELL_FOCUSED to flags.

	* e-table-item.c: Changed the background color of selected cells
	if the widget is focused.  Send E_CELL_FOCUSED to flags if the
	widget is focused.

	* e-table.c: Repaint the window if focus changes.

svn path=/trunk/; revision=6010
This commit is contained in:
Christopher James Lahey
2000-10-19 01:08:44 +00:00
committed by Chris Lahey
parent 6da38957bf
commit 0e2492ca58
4 changed files with 17 additions and 2 deletions

View File

@ -489,7 +489,10 @@ ect_draw (ECellView *ecell_view, GdkDrawable *drawable,
clip_rect = &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];
}

View File

@ -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 {

View File

@ -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;

View File

@ -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",