From 56824b130b786aab49876a71c6c768a17c5a4f1c Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Fri, 10 Dec 2010 20:31:46 +0000 Subject: Replace txt_widget_t#selectable with a callback function to query whether the widget is selectable. This stops the table code from selecting things that aren't really selectable - eg. empty tables, scrollpanes containing unselectable widgets, etc. Fixes a bug with the warp menu (thanks Proteh). Subversion-branch: /trunk/chocolate-doom Subversion-revision: 2207 --- textscreen/txt_checkbox.c | 1 + 1 file changed, 1 insertion(+) (limited to 'textscreen/txt_checkbox.c') diff --git a/textscreen/txt_checkbox.c b/textscreen/txt_checkbox.c index 0cb06bad..75afa986 100644 --- a/textscreen/txt_checkbox.c +++ b/textscreen/txt_checkbox.c @@ -117,6 +117,7 @@ static void TXT_CheckBoxMousePress(TXT_UNCAST_ARG(checkbox), int x, int y, int b txt_widget_class_t txt_checkbox_class = { + TXT_AlwaysSelectable, TXT_CheckBoxSizeCalc, TXT_CheckBoxDrawer, TXT_CheckBoxKeyPress, -- cgit v1.2.3 From 83fb03a0e09920ec324734e9ae3a6cd15fb041e7 Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Mon, 31 Jan 2011 01:25:47 +0000 Subject: When large numbers of screen resolutions are detected, increase the number of columns in the mode list to fit them all on-screen. Remove superfluous left-side spacing from the checkbox and radio button widgets so that the modes can be packed closer together. Subversion-branch: /trunk/chocolate-doom Subversion-revision: 2242 --- textscreen/txt_checkbox.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'textscreen/txt_checkbox.c') diff --git a/textscreen/txt_checkbox.c b/textscreen/txt_checkbox.c index 75afa986..35c5739d 100644 --- a/textscreen/txt_checkbox.c +++ b/textscreen/txt_checkbox.c @@ -34,9 +34,9 @@ static void TXT_CheckBoxSizeCalc(TXT_UNCAST_ARG(checkbox)) { TXT_CAST_ARG(txt_checkbox_t, checkbox); - // Minimum width is the string length + two spaces for padding + // Minimum width is the string length + right-side space for padding - checkbox->widget.w = strlen(checkbox->label) + 6; + checkbox->widget.w = strlen(checkbox->label) + 5; checkbox->widget.h = 1; } @@ -50,7 +50,7 @@ static void TXT_CheckBoxDrawer(TXT_UNCAST_ARG(checkbox), int selected) TXT_BGColor(TXT_COLOR_BLUE, 0); TXT_FGColor(TXT_COLOR_BRIGHT_CYAN); - TXT_DrawString(" ("); + TXT_DrawString("("); TXT_FGColor(TXT_COLOR_BRIGHT_WHITE); @@ -76,7 +76,7 @@ static void TXT_CheckBoxDrawer(TXT_UNCAST_ARG(checkbox), int selected) TXT_DrawString(checkbox->label); - for (i=strlen(checkbox->label); i < w-6; ++i) + for (i=strlen(checkbox->label); i < w-5; ++i) { TXT_DrawString(" "); } -- cgit v1.2.3