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:
parent
118d97cd90
commit
2d590a81e0
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user