1
0
mirror of https://github.com/Tha14/toxic.git synced 2024-11-27 01:03:26 +01:00

Added define that fixes text not being visible on rxvt-unicode.

This commit is contained in:
irungentoo 2013-09-26 09:51:21 -04:00
parent e51ebd9c7c
commit 7da72b79ef
2 changed files with 19 additions and 4 deletions

View File

@ -37,6 +37,10 @@
#define MAGENTA 6 #define MAGENTA 6
#define BLACK 7 #define BLACK 7
/* Fixes text color problem on some terminals.
Uncomment if necessary */
//#define URXVT_FIX
typedef struct ToxWindow_ ToxWindow; typedef struct ToxWindow_ ToxWindow;
struct ToxWindow_ { struct ToxWindow_ {

View File

@ -154,8 +154,10 @@ int add_window(Tox *m, ToxWindow w)
if (w.window == NULL) if (w.window == NULL)
return -1; return -1;
#ifdef URXVT_FIX
wbkgd(w.window, COLOR_PAIR(0)); /* Fixes text color problem on some terminals. */
wbkgd(w.window, COLOR_PAIR(6));
#endif
windows[i] = w; windows[i] = w;
w.onInit(&w, m); w.onInit(&w, m);
@ -245,8 +247,13 @@ static void draw_bar()
for (i = 0; i < MAX_WINDOWS_NUM; ++i) { for (i = 0; i < MAX_WINDOWS_NUM; ++i) {
if (windows[i].window) { if (windows[i].window) {
if (windows + i == active_window) if (windows + i == active_window) {
#ifdef URXVT_FIX
attron(A_BOLD | COLOR_PAIR(GREEN));
} else {
#endif
attron(A_BOLD); attron(A_BOLD);
}
odd = (odd + 1) % blinkrate; odd = (odd + 1) % blinkrate;
@ -260,6 +267,10 @@ static void draw_bar()
attroff(COLOR_PAIR(RED)); attroff(COLOR_PAIR(RED));
if (windows + i == active_window) { if (windows + i == active_window) {
#ifdef URXVT_FIX
attroff(A_BOLD | COLOR_PAIR(GREEN));
} else {
#endif
attroff(A_BOLD); attroff(A_BOLD);
} }
} }