From 9ffd1cc4d4bbd2b2799cbd0bf927fc4f30aed63e Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Thu, 1 Mar 2012 20:26:56 +0000 Subject: 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 --- textscreen/txt_widget.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'textscreen/txt_widget.c') 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. } } -- cgit v1.2.3