summaryrefslogtreecommitdiff
path: root/textscreen/txt_widget.c
diff options
context:
space:
mode:
authorSimon Howard2012-03-01 20:26:56 +0000
committerSimon Howard2012-03-01 20:26:56 +0000
commit9ffd1cc4d4bbd2b2799cbd0bf927fc4f30aed63e (patch)
tree06e5d3599db4c7bec3bcc032a241424d0bccc7e3 /textscreen/txt_widget.c
parent920ffea9b631e712ff0826911db01a76edbe7521 (diff)
downloadchocolate-doom-9ffd1cc4d4bbd2b2799cbd0bf927fc4f30aed63e.tar.gz
chocolate-doom-9ffd1cc4d4bbd2b2799cbd0bf927fc4f30aed63e.tar.bz2
chocolate-doom-9ffd1cc4d4bbd2b2799cbd0bf927fc4f30aed63e.zip
Rework the way that window background colors are set, and change the
background color of inactive windows to black, to give better contrast when viewing many layered windows. Subversion-branch: /trunk/chocolate-doom Subversion-revision: 2507
Diffstat (limited to 'textscreen/txt_widget.c')
-rw-r--r--textscreen/txt_widget.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/textscreen/txt_widget.c b/textscreen/txt_widget.c
index 7d31ad68..e0303531 100644
--- a/textscreen/txt_widget.c
+++ b/textscreen/txt_widget.c
@@ -162,14 +162,22 @@ void TXT_CalcWidgetSize(TXT_UNCAST_ARG(widget))
void TXT_DrawWidget(TXT_UNCAST_ARG(widget))
{
TXT_CAST_ARG(txt_widget_t, widget);
+ txt_saved_colors_t colors;
+
+ // The drawing function might change the fg/bg colors,
+ // so make sure we restore them after it's done.
+
+ TXT_SaveColors(&colors);
// For convenience...
TXT_GotoXY(widget->x, widget->y);
// Call drawer method
-
+
widget->widget_class->drawer(widget);
+
+ TXT_RestoreColors(&colors);
}
void TXT_DestroyWidget(TXT_UNCAST_ARG(widget))
@@ -319,7 +327,7 @@ void TXT_SetWidgetBG(TXT_UNCAST_ARG(widget))
}
else
{
- TXT_BGColor(TXT_WINDOW_BACKGROUND, 0);
+ // Use normal window background.
}
}