foxygit / doom Log in
commit ef4d10f97870d0cfc26fd3c60b0644ace0774678
Author:     Simon Howard <fraggle@soulsphere.org>
AuthorDate: Thu Jun 9 23:02:57 2016 -0400
Commit:     Simon Howard <fraggle@soulsphere.org>
CommitDate: Thu Jun 9 23:02:57 2016 -0400

    textscreen: Make file select more distinguishing.

    File selectors widgets currently just look like an empty area of
    background. Because of this they can be hard to identify as widgets.
    To make them more distinguishing give them a black background, and
    add a triple bar next to them.
---
 textscreen/txt_fileselect.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/textscreen/txt_fileselect.c b/textscreen/txt_fileselect.c
index 5d83c15c..c9740725 100644
--- a/textscreen/txt_fileselect.c
+++ b/textscreen/txt_fileselect.c
@@ -23,6 +23,8 @@

 #include "txt_fileselect.h"
 #include "txt_inputbox.h"
+#include "txt_gui.h"
+#include "txt_io.h"
 #include "txt_main.h"
 #include "txt_widget.h"

@@ -587,11 +589,14 @@ static void TXT_FileSelectDrawer(TXT_UNCAST_ARG(fileselect))
     // Input box widget inherits all the properties of the
     // file selector.

-    fileselect->inputbox->widget.x = fileselect->widget.x;
+    fileselect->inputbox->widget.x = fileselect->widget.x + 2;
     fileselect->inputbox->widget.y = fileselect->widget.y;
-    fileselect->inputbox->widget.w = fileselect->widget.w;
+    fileselect->inputbox->widget.w = fileselect->widget.w - 2;
     fileselect->inputbox->widget.h = fileselect->widget.h;

+    // Triple bar symbol gives a distinguishing look to the file selector.
+    TXT_DrawString("\xf0 ");
+    TXT_BGColor(TXT_COLOR_BLACK, 0);
     TXT_DrawWidget(fileselect->inputbox);
 }