spdk_top: change border line display in tab window

Currently we use box() function to draw borders of tab windows.
This may be causing jumbled display in some terminals, when displaying
vertical lines inside tab window (as seen in #2053), so this
patch aims to change this.

Additionally changed length value of vertical line separating
tab menu from data rows, to avoid going "outside" the screen.

Change-Id: Ie842bb8c958a6c3aebef81e3a0e9f7b3d74dff53
Signed-off-by: Krzysztof Karas <krzysztof.karas@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9415
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Chengqiang Meng <chengqiangx.meng@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
This commit is contained in:
Krzysztof Karas 2021-09-06 08:54:58 +00:00 committed by Tomasz Zawadzki
parent c17c7b9564
commit 2510b74e9d

View File

@ -1071,6 +1071,7 @@ draw_tabs(enum tabs tab_index, uint8_t sort_col)
WINDOW *tab = g_tabs[tab_index];
int i, j;
uint16_t offset, draw_offset;
uint16_t tab_height = g_max_row - MENU_WIN_HEIGHT - TAB_WIN_HEIGHT - 3;
for (i = 0; col_desc[i].name != NULL; i++) {
if (col_desc[i].disabled) {
@ -1101,8 +1102,12 @@ draw_tabs(enum tabs tab_index, uint8_t sort_col)
}
print_max_len(tab, 2, 1, 0, ALIGN_LEFT, ""); /* Move to next line */
whline(tab, ACS_HLINE, MAX_STRING_LEN);
box(tab, 0, 0);
whline(tab, ACS_HLINE, g_max_col - 2);
/* Border lines */
mvwhline(tab, 0, 1, ACS_HLINE, g_max_col - 2);
mvwhline(tab, tab_height, 1, ACS_HLINE, g_max_col - 2);
wrefresh(tab);
}