Skip to content

Instantly share code, notes, and snippets.

@drscream
Created June 23, 2018 10:55
Show Gist options
  • Save drscream/b2b0d9b71af4d8ba973da34a9ad25afe to your computer and use it in GitHub Desktop.
Save drscream/b2b0d9b71af4d8ba973da34a9ad25afe to your computer and use it in GitHub Desktop.
$NetBSD$
--- mcabber/screen.c.orig 2017-06-04 21:13:16.000000000 +0000
+++ mcabber/screen.c
@@ -1266,7 +1266,7 @@ static void scr_update_window(winbuf *wi
color = COLOR_GENERAL;
if (color != COLOR_GENERAL)
- wattrset(win_entry->win, get_color(color));
+ wbkgdset(win_entry->win, get_color(color));
// Generate the prefix area and display it
@@ -1276,10 +1276,10 @@ static void scr_update_window(winbuf *wi
tmp = pref[timelen];
pref[timelen] = '\0';
- wattrset(win_entry->win, get_color(COLOR_TIMESTAMP));
+ wbkgdset(win_entry->win, get_color(COLOR_TIMESTAMP));
wprintw(win_entry->win, pref);
pref[timelen] = tmp;
- wattrset(win_entry->win, get_color(color));
+ wbkgdset(win_entry->win, get_color(color));
wprintw(win_entry->win, pref+timelen);
} else
wprintw(win_entry->win, pref);
@@ -1334,12 +1334,12 @@ static void scr_update_window(winbuf *wi
if (actual && ((type == MC_ALL) || (actual->manual))
&& (line->flags & HBB_PREFIX_IN) &&
(!(line->flags & HBB_PREFIX_HLIGHT_OUT)))
- wattrset(win_entry->win, compose_color(actual->color));
+ wbkgdset(win_entry->win, compose_color(actual->color));
wprintw(win_entry->win, "%s", line->text);
// Return the char
line->text[line->mucnicklen] = tmp;
// Return the color back
- wattrset(win_entry->win, get_color(color));
+ wbkgdset(win_entry->win, get_color(color));
}
// Display text line
@@ -1356,19 +1356,19 @@ scr_update_window_skipline:
winy = n + mark_offset;
wmove(win_entry->win, winy, 0);
color = COLOR_READMARK;
- wattrset(win_entry->win, get_color(color));
+ wbkgdset(win_entry->win, get_color(color));
g_snprintf(pref, prefixwidth, " == ");
wprintw(win_entry->win, pref);
w = scr_gettextwidth() / 3;
for (i=0; i<w; i++)
wprintw(win_entry->win, "== ");
wclrtoeol(win_entry->win);
- wattrset(win_entry->win, get_color(COLOR_GENERAL));
+ wbkgdset(win_entry->win, get_color(COLOR_GENERAL));
}
// Restore default ("general") color
if (color != COLOR_GENERAL)
- wattrset(win_entry->win, get_color(COLOR_GENERAL));
+ wbkgdset(win_entry->win, get_color(COLOR_GENERAL));
g_free(line->text);
g_free(line);
@@ -1760,7 +1760,7 @@ void scr_draw_main_window(unsigned int f
wbkgd(chatstatusWnd, get_color(COLOR_STATUS));
wbkgd(mainstatusWnd, get_color(COLOR_STATUS));
- wattrset(logWnd, get_color(COLOR_LOG));
+ wbkgdset(logWnd, get_color(COLOR_LOG));
} else {
/* Resize/move windows */
wresize(rosterWnd, CHAT_WIN_HEIGHT, Roster_Width);
@@ -2130,7 +2130,7 @@ void scr_draw_roster(void)
if (Roster_Width) {
int line_x_pos = roster_win_on_right ? 0 : Roster_Width-1;
// Redraw the vertical line (not very good...)
- wattrset(rosterWnd, get_color(COLOR_GENERAL));
+ wbkgdset(rosterWnd, get_color(COLOR_GENERAL));
for (i=0 ; i < CHAT_WIN_HEIGHT ; i++)
mvwaddch(rosterWnd, i, line_x_pos, ACS_VLINE);
}
@@ -2239,16 +2239,16 @@ void scr_draw_roster(void)
}
if (buddy == current_buddy) {
if (pending == '#')
- wattrset(rosterWnd, get_color(COLOR_ROSTERSELNMSG));
+ wbkgdset(rosterWnd, get_color(COLOR_ROSTERSELNMSG));
else
- wattrset(rosterWnd, get_color(COLOR_ROSTERSEL));
+ wbkgdset(rosterWnd, get_color(COLOR_ROSTERSEL));
// The 3 following lines aim at coloring the whole line
wmove(rosterWnd, i, x_pos);
for (n = 0; n < maxx; n++)
waddch(rosterWnd, ' ');
} else {
if (pending == '#')
- wattrset(rosterWnd, get_color(COLOR_ROSTERNMSG));
+ wbkgdset(rosterWnd, get_color(COLOR_ROSTERNMSG));
else {
int color = get_color(COLOR_ROSTER);
if ((!isspe) && (!isgrp)) { // Look for color rules
@@ -2263,7 +2263,7 @@ void scr_draw_roster(void)
}
}
}
- wattrset(rosterWnd, color);
+ wbkgdset(rosterWnd, color);
}
}
@@ -4187,9 +4187,9 @@ static inline void print_checked_line(vo
while (*ptrCur && nrchar-- > 0) {
point = ptrCur - inputLine;
if (maskLine[point])
- wattrset(inputWnd, A_UNDERLINE);
+ wbkgdset(inputWnd, A_UNDERLINE);
wprintw(inputWnd, wprint_char_fmt, get_char(ptrCur));
- wattrset(inputWnd, A_NORMAL);
+ wbkgdset(inputWnd, A_NORMAL);
ptrCur = next_char(ptrCur);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment