summaryrefslogtreecommitdiff
path: root/textscreen/txt_window.c
diff options
context:
space:
mode:
authorSimon Howard2006-06-20 18:48:21 +0000
committerSimon Howard2006-06-20 18:48:21 +0000
commitcef6abcea6218c9638ba67edca9755f7d3fa359f (patch)
treedbf0a32d8864397d78bf3723151ed2508b5542ef /textscreen/txt_window.c
parent87cbe9dbbe6a0921f89e08d79b87fad7aec37cd8 (diff)
downloadchocolate-doom-cef6abcea6218c9638ba67edca9755f7d3fa359f.tar.gz
chocolate-doom-cef6abcea6218c9638ba67edca9755f7d3fa359f.tar.bz2
chocolate-doom-cef6abcea6218c9638ba67edca9755f7d3fa359f.zip
Always add a bit of padding inside windows (removes the need to add padding
explicitly in labels). Set the window title from the desktop title. Only draw widget selection highlight in the window with focus (top window). Subversion-branch: /trunk/chocolate-doom Subversion-revision: 560
Diffstat (limited to 'textscreen/txt_window.c')
-rw-r--r--textscreen/txt_window.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/textscreen/txt_window.c b/textscreen/txt_window.c
index 5da2e008..d9a3abca 100644
--- a/textscreen/txt_window.c
+++ b/textscreen/txt_window.c
@@ -221,14 +221,14 @@ void TXT_LayoutWindow(txt_window_t *window)
TXT_CalcWidgetSize(window);
+ // Widgets area: add one character of padding on each side
+ widgets_w = widgets->w + 2;
+
// Calculate the size of the action area
+ // Make window wide enough to action area
actionarea_w = ActionAreaWidth(window);
- // Which one is larger?
-
- widgets_w = widgets->w;
-
if (actionarea_w > widgets_w)
widgets_w = actionarea_w;
@@ -251,9 +251,9 @@ void TXT_LayoutWindow(txt_window_t *window)
// Set the table size and position
- widgets->w = widgets_w;
+ widgets->w = widgets_w - 2;
// widgets->h (already set)
- widgets->x = window->window_x + 1;
+ widgets->x = window->window_x + 2;
widgets->y = window->window_y + window->window_h - widgets->h - 3;
// Layout the table and action area
@@ -262,7 +262,7 @@ void TXT_LayoutWindow(txt_window_t *window)
TXT_LayoutWidget(widgets);
}
-void TXT_DrawWindow(txt_window_t *window)
+void TXT_DrawWindow(txt_window_t *window, int selected)
{
txt_widget_t *widgets;
int x, y;
@@ -279,7 +279,7 @@ void TXT_DrawWindow(txt_window_t *window)
// Draw all widgets
- TXT_DrawWidget(window, 1);
+ TXT_DrawWidget(window, selected);
// Separator for action area