summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJari Vetoniemi <mailroxas@gmail.com>2014-04-14 19:33:50 +0300
committerJari Vetoniemi <mailroxas@gmail.com>2014-04-14 19:33:50 +0300
commit7533cebfe531f2264b10903a5d1b8a0d60b9fcae (patch)
tree32f1de9d500e492f0efcf14a721d2c5ee125b945
parent617c4ab827d9c71a122034594bb1080607f50398 (diff)
downloadbemenu-7533cebfe531f2264b10903a5d1b8a0d60b9fcae.tar.gz
bemenu-7533cebfe531f2264b10903a5d1b8a0d60b9fcae.tar.bz2
bemenu-7533cebfe531f2264b10903a5d1b8a0d60b9fcae.zip
Tell curses to use terminal default colors
-rw-r--r--lib/draw/curses.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/draw/curses.c b/lib/draw/curses.c
index 2cc84af..f8137b8 100644
--- a/lib/draw/curses.c
+++ b/lib/draw/curses.c
@@ -76,6 +76,7 @@ static struct curses {
int (*attroff)(int attrs);
int (*attron)(int attrs);
int (*start_color)(void);
+ int (*use_default_colors)(void);
int (*getmaxx)(WINDOW *win);
int (*getmaxy)(WINDOW *win);
int (*keypad)(WINDOW *win, bool bf);
@@ -199,8 +200,9 @@ static void _bmDrawCursesRender(const bmMenu *menu)
curses.raw();
curses.start_color();
+ curses.use_default_colors();
curses.init_pair(1, COLOR_BLACK, COLOR_RED);
- curses.init_pair(2, COLOR_RED, COLOR_BLACK);
+ curses.init_pair(2, COLOR_RED, -1);
}
const unsigned int lines = curses.getmaxy(curses.stdscr);
@@ -432,6 +434,8 @@ int _bmDrawCursesInit(struct _bmRenderApi *api)
goto function_pointer_exception;
if (!bmLoadFunction(start_color))
goto function_pointer_exception;
+ if (!bmLoadFunction(use_default_colors))
+ goto function_pointer_exception;
if (!bmLoadFunction(getmaxx))
goto function_pointer_exception;
if (!bmLoadFunction(getmaxy))