1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-11-03 19:37:16 -05:00

Status bar message now correctly overwrites previous message

This commit is contained in:
James Booth 2012-11-19 23:56:54 +00:00
parent 118d97cd90
commit 2d590a81e0

View File

@ -184,13 +184,31 @@ status_bar_get_password(void)
void
status_bar_print_message(const char * const msg)
{
if (message != NULL)
if (message != NULL) {
free(message);
message = NULL;
}
wclear(status_bar);
message = (char *) malloc((strlen(msg) + 1) * sizeof(char));
strcpy(message, msg);
mvwprintw(status_bar, 0, 9, message);
int cols = getmaxx(stdscr);
wattron(status_bar, COLOUR_BAR_DRAW);
mvwprintw(status_bar, 0, cols - 29, _active);
wattroff(status_bar, COLOUR_BAR_DRAW);
int i;
for(i = 0; i < 9; i++) {
if (is_new[i])
status_bar_new(i+1);
else if (is_active[i])
status_bar_active(i+1);
}
dirty = TRUE;
}