summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorP. J. McDermott <pj@pehjota.net>2015-10-29 17:29:08 (EDT)
committer P. J. McDermott <pj@pehjota.net>2015-10-29 17:29:08 (EDT)
commit2a05d14994cfda03d812148b585f589f633c3357 (patch)
tree62b99fb9c121144c592bdf0f45203a151603ea2d
parent8c6d6d848c7e38842f7f6a65d255afca08f60a72 (diff)
downloadfirman.sh-2a05d14994cfda03d812148b585f589f633c3357.zip
firman.sh-2a05d14994cfda03d812148b585f589f633c3357.tar.gz
firman.sh-2a05d14994cfda03d812148b585f589f633c3357.tar.bz2
tui_show_prompt(): Draw box, not underlined field
The Linux console handles SGR parameter 4 with color instead of an underline.
-rw-r--r--src/ui/tui.sh28
1 files changed, 15 insertions, 13 deletions
diff --git a/src/ui/tui.sh b/src/ui/tui.sh
index 2c572bf..ed43299 100644
--- a/src/ui/tui.sh
+++ b/src/ui/tui.sh
@@ -332,7 +332,8 @@ tui_show_prompt()
local y=
local x=
local i=
- local line=''
+ local iline=''
+ local bline=''
local input=''
local curpos=0
local focus=0
@@ -346,7 +347,7 @@ tui_show_prompt()
w=$(expr ${len} + 7)
fi
read -r y x <<-EOF
- $(_tui_box ${w} 7)
+ $(_tui_box ${w} 9)
EOF
# Write the title.
@@ -357,14 +358,15 @@ tui_show_prompt()
# Build blank input line.
i=0
while [ ${i} -le ${len} ]; do
- line="${line} "
+ bline="${bline}-"
+ iline="${iline} "
i=$(($i + 1))
done
# Event loop.
while :; do
# Draw a button.
- term_cursor_position $(($y + 5)) $(($x + $w - 6))
+ term_cursor_position $(($y + 7)) $(($x + $w - 6))
if [ ${focus} -eq 1 ]; then
term_attr_on reverse
term_write '[OK]'
@@ -375,20 +377,20 @@ tui_show_prompt()
# Draw a textbox.
term_cursor_position $(($y + 3)) $(($x + 2))
- term_write '['
- term_attr_on underline
- term_write "${line}"
- term_attr_off underline
- term_write ']'
- term_cursor_position $(($y + 3)) $(($x + 3))
- term_attr_on underline
+ term_write "+${bline}+"
+ term_cursor_position $(($y + 4)) $(($x + 2))
+ term_write "|${iline}|"
+ term_cursor_position $(($y + 5)) $(($x + 2))
+ term_write "+${bline}+"
+
+ # Draw input.
+ term_cursor_position $(($y + 4)) $(($x + 3))
term_write "${input}"
- term_attr_off underline
# Put the cursor in the text box.
if [ ${focus} -eq 0 ]; then
term_show_cursor
- term_cursor_position $(($y + 3)) $(($x + 3 + $curpos))
+ term_cursor_position $(($y + 4)) $(($x + 3 + $curpos))
else
term_hide_cursor
fi