diff options
Diffstat (limited to 'src/ui')
-rw-r--r-- | src/ui/tui.sh | 28 |
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 |