From 5e2763d40f93d3222707d0063b993c0d01a3e18e Mon Sep 17 00:00:00 2001 From: PAVAN Date: Tue, 1 May 2018 23:20:46 +0530 Subject: [PATCH] fixes issue #110 - DEV colum length to 15 --- src/cui.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/cui.cpp b/src/cui.cpp index d365a16..4df58d6 100644 --- a/src/cui.cpp +++ b/src/cui.cpp @@ -54,7 +54,7 @@ extern unsigned refreshcount; const int COLUMN_WIDTH_PID = 7; const int COLUMN_WIDTH_USER = 8; -const int COLUMN_WIDTH_DEV = 5; +const int COLUMN_WIDTH_DEV = 15; const int COLUMN_WIDTH_SENT = 11; const int COLUMN_WIDTH_RECEIVED = 11; const int COLUMN_WIDTH_UNIT = 6; @@ -334,14 +334,14 @@ void show_ncurses(Line *lines[], int nproc) { if (cols > PROGNAME_WIDTH) cols = PROGNAME_WIDTH; - proglen = cols - 55; + proglen = cols - 65; erase(); mvprintw(0, 0, "%s", caption->c_str()); attron(A_REVERSE); mvprintw(2, 0, - " PID USER %-*.*s DEV SENT RECEIVED ", - proglen, proglen, "PROGRAM"); + " PID USER %-*.*s %-*.*s SENT RECEIVED ", + proglen, proglen, "PROGRAM",15,15,"DEV"); attroff(A_REVERSE); /* print them */ @@ -353,11 +353,10 @@ void show_ncurses(Line *lines[], int nproc) { sent_global += lines[i]->sent_value; delete lines[i]; } - attron(A_REVERSE); int totalrow = std::min(rows - 1, 3 + 1 + i); - mvprintw(totalrow, 0, " TOTAL %-*.*s %11.3f %11.3f ", - proglen, proglen, " ", sent_global, recv_global); + mvprintw(totalrow, 0, " TOTAL %-*.*s %-*.*s %11.3f %11.3f ", + proglen, proglen, "", 15,15, "", sent_global, recv_global); if (viewMode == VIEWMODE_KBPS) { mvprintw(3 + 1 + i, cols - COLUMN_WIDTH_UNIT, "KB/sec "); } else if (viewMode == VIEWMODE_TOTAL_B) {