forked from Mirrors/sngrep
Fixed a bug in call raw scrolling
Removed percentage in call list screen when reached the bottom
This commit is contained in:
parent
a972bfad7a
commit
aa164cbe16
|
@ -169,7 +169,7 @@ call_list_draw(PANEL *panel)
|
|||
|
||||
// Clean scroll information
|
||||
mvwprintw(win, startline, 2, " ");
|
||||
mvwprintw(win, startline + info->linescnt - 2, 2, " ");
|
||||
mvwprintw(win, startline + info->linescnt - 2, 1, " ");
|
||||
mvwprintw(win, startline + info->linescnt - 1, 2, " ");
|
||||
|
||||
// Update the scroll information
|
||||
|
@ -179,8 +179,10 @@ call_list_draw(PANEL *panel)
|
|||
}
|
||||
|
||||
// Set the current line % if we have more calls that available lines
|
||||
if (callcnt > info->linescnt) mvwprintw(win, startline + info->linescnt - 2, 1, "%2d%%",
|
||||
(info->first_line + info->cur_line) * 100 / callcnt);
|
||||
int percentage = (info->first_line + info->cur_line) * 100 / callcnt;
|
||||
if (callcnt > info->linescnt && percentage < 100) {
|
||||
mvwprintw(win, startline + info->linescnt - 2, 1, "%2d%%", percentage);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -75,6 +75,7 @@ call_raw_draw(PANEL *panel)
|
|||
into the panel window, taking into account the scroll position.
|
||||
This is dirty but easier to manage by now
|
||||
*/
|
||||
memset(all_lines, 0, 1024);
|
||||
while ((msg = get_next_msg(info->call, msg))) {
|
||||
for (raw_line = 0; raw_line < msg->plines; raw_line++) {
|
||||
all_lines[all_linescnt++] = msg->payload[raw_line];
|
||||
|
@ -84,8 +85,12 @@ call_raw_draw(PANEL *panel)
|
|||
}
|
||||
info->all_lines = all_linescnt;
|
||||
|
||||
for (raw_line = info->scrollpos; raw_line - info->scrollpos < info->linescnt; raw_line++) {
|
||||
for (raw_line = info->scrollpos; raw_line <= all_linescnt; raw_line++) {
|
||||
// Until we have reached the end of the screen
|
||||
if (pline >= info->linescnt) break;
|
||||
// If printable line, otherwise let this line empty
|
||||
if (all_lines[raw_line]) mvwprintw(win, pline, 0, "%s", all_lines[raw_line]);
|
||||
// but increase line counter
|
||||
pline++;
|
||||
}
|
||||
return 0;
|
||||
|
|
Loading…
Reference in New Issue