shithub: choc

Download patch

ref: ef4d10f97870d0cfc26fd3c60b0644ace0774678
parent: ad113dcdd09405e81214e0f477dc44d49f6bcac8
author: Simon Howard <[email protected]>
date: Thu Jun 9 19:02:57 EDT 2016

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.

--- 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 @@
     // 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);
 }