From: H. Peter Anvin Date: Tue, 5 Jun 2007 21:08:01 +0000 (-0700) Subject: Fix alignment of tab and timeout messages X-Git-Tag: syslinux-3.50-pre19^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=64f2f028926ae3bc6de7d99130f5ac03a69c3c0d;p=profile%2Fivi%2Fsyslinux.git Fix alignment of tab and timeout messages --- diff --git a/com32/modules/menumain.c b/com32/modules/menumain.c index 6f890f2..f5d2dd3 100644 --- a/com32/modules/menumain.c +++ b/com32/modules/menumain.c @@ -440,6 +440,7 @@ draw_menu(int sel, int top, int edit_line) int x, y; int sbtop = 0, sbbot = 0; const char *tabmsg; + int tabmsg_len; if ( nentries > MENU_ROWS ) { int sblen = MENU_ROWS*MENU_ROWS/nentries; @@ -476,7 +477,10 @@ draw_menu(int sel, int top, int edit_line) else tabmsg = messages[MSG_NOTAB].msg; - printf("\1#8\033[%d;1H%s", TABMSG_ROW, pad_line(tabmsg, 1, WIDTH)); + tabmsg_len = strlen(tabmsg); + + printf("\1#8\033[%d;%dH%s", + TABMSG_ROW, 1+HSHIFT+((WIDTH-tabmsg_len)>>1), tabmsg); printf("\1#0\033[%d;1H", END_ROW); } @@ -816,7 +820,8 @@ run_menu(void) } *tq = '\0'; - printf("\033[%d;%dH\2#14 %s ", TIMEOUT_ROW, HSHIFT+1+((WIDTH-nc)>>1), buf); + printf("\033[%d;%dH\2#14 %s ", TIMEOUT_ROW, + HSHIFT+1+((WIDTH-nc-2)>>1), buf); to_clear = 1; } else { to_clear = 0;