draw pixmaps with he right background and selection colors.

2000-06-23  Larry Ewing  <lewing@helixcode.com>

	* e-cell-toggle.c (etog_draw): draw pixmaps with he right
	background and selection colors.

svn path=/trunk/; revision=3709
This commit is contained in:
Larry Ewing
2000-06-23 16:22:50 +00:00
committed by Larry Ewing
parent 45cca0f241
commit b92cdaf00a
3 changed files with 23 additions and 2 deletions

View File

@ -1,3 +1,8 @@
2000-06-23 Larry Ewing <lewing@helixcode.com>
* e-cell-toggle.c (etog_draw): draw pixmaps with he right
background and selection colors.
2000-06-23 Chris Toshok <toshok@helixcode.com>
* e-tree-model.h, e-tree-model.c: add icon_at virtual function -

View File

@ -91,6 +91,8 @@ etog_draw (ECellView *ecell_view, GdkDrawable *drawable,
ECellToggleView *toggle_view = (ECellToggleView *) ecell_view;
GdkPixbuf *image;
int x, y, width, height;
GdkColor *background;
const int value = GPOINTER_TO_INT (
e_table_model_value_at (ecell_view->e_table_model, model_col, row));
@ -103,7 +105,13 @@ etog_draw (ECellView *ecell_view, GdkDrawable *drawable,
/*
* Paint the background
*/
gdk_draw_rectangle (drawable, GTK_WIDGET (toggle_view->canvas)->style->white_gc, TRUE, x1, y1, x2 - x1, y2 - y1);
if (selected){
background = &GTK_WIDGET (toggle_view->canvas)->style->bg [GTK_STATE_SELECTED];
} else {
background = &GTK_WIDGET (toggle_view->canvas)->style->base [GTK_STATE_NORMAL];
}
gdk_gc_set_foreground (toggle_view->gc, background);
gdk_draw_rectangle (drawable, toggle_view->gc, TRUE, x1, y1, x2 - x1, y2 - y1);
image = toggle->images [value];

View File

@ -91,6 +91,8 @@ etog_draw (ECellView *ecell_view, GdkDrawable *drawable,
ECellToggleView *toggle_view = (ECellToggleView *) ecell_view;
GdkPixbuf *image;
int x, y, width, height;
GdkColor *background;
const int value = GPOINTER_TO_INT (
e_table_model_value_at (ecell_view->e_table_model, model_col, row));
@ -103,7 +105,13 @@ etog_draw (ECellView *ecell_view, GdkDrawable *drawable,
/*
* Paint the background
*/
gdk_draw_rectangle (drawable, GTK_WIDGET (toggle_view->canvas)->style->white_gc, TRUE, x1, y1, x2 - x1, y2 - y1);
if (selected){
background = &GTK_WIDGET (toggle_view->canvas)->style->bg [GTK_STATE_SELECTED];
} else {
background = &GTK_WIDGET (toggle_view->canvas)->style->base [GTK_STATE_NORMAL];
}
gdk_gc_set_foreground (toggle_view->gc, background);
gdk_draw_rectangle (drawable, toggle_view->gc, TRUE, x1, y1, x2 - x1, y2 - y1);
image = toggle->images [value];