# 01-backtitle
# format a centered string for dialog back title

#-----------------------------
# format text for centered backtitle
set_bt() {
   # choose text
   T="SLOS Firstboot"
   # figure margin needed to center text
   Tw="${#T}"          # title width
   Lw="$(((WM-Tw)/2))" # left margin = ScreenWidth - TitleWidth / 2
   # format margin+text to create centered text
   # BT=$(printf "%${Lw}s" "$T") ## why why why does this not work???
   BT=""
   c=$Lw; while [ $c -gt 2 ] ; do BT="${BT}="; c=$((c-1)); done
   BT="${BT} $T "
   c=$Lw; while [ $c -gt 2 ] ; do BT="${BT}="; c=$((c-1)); done
   log "BT >>>$BT<<<"
} # set_bt

# setup backtitle text
set_bt

