From e980c7ff1814b533f674eec535af6c5658b1bc62 Mon Sep 17 00:00:00 2001 From: "Anselm R. Garbe" Date: Thu, 24 Aug 2006 11:47:08 +0200 Subject: migrated dmenu to use 4 instead of 3 colors --- main.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'main.c') diff --git a/main.c b/main.c index 840a7bc..c3cad1d 100644 --- a/main.c +++ b/main.c @@ -77,17 +77,17 @@ drawmenu() dc.y = 0; dc.w = mw; dc.h = mh; - drawtext(NULL, False, False); + drawtext(NULL, 0, False); /* print command */ if(cmdw && item) dc.w = cmdw; - drawtext(text[0] ? text : NULL, False, False); + drawtext(text[0] ? text : NULL, 0, False); dc.x += cmdw; if(curr) { dc.w = SPACE; - drawtext((curr && curr->left) ? "<" : NULL, False, False); + drawtext((curr && curr->left) ? "<" : NULL, 0, False); dc.x += dc.w; /* determine maximum items */ @@ -95,13 +95,13 @@ drawmenu() dc.w = textw(i->text); if(dc.w > mw / 3) dc.w = mw / 3; - drawtext(i->text, sel == i, sel == i); + drawtext(i->text, sel == i ? 1 : 0, sel == i); dc.x += dc.w; } dc.x = mw - SPACE; dc.w = SPACE; - drawtext(next ? ">" : NULL, False, False); + drawtext(next ? ">" : NULL, 0, False); } XCopyArea(dpy, dc.drawable, win, dc.gc, 0, 0, mw, mh, 0, 0); XFlush(dpy); @@ -315,9 +315,10 @@ main(int argc, char *argv[]) usleep(1000); /* style */ - dc.bg = getcolor(BGCOLOR); - dc.fg = getcolor(FGCOLOR); - dc.border = getcolor(BORDERCOLOR); + dc.bg[0] = getcolor(NORMBGCOLOR); + dc.fg[0] = getcolor(NORMFGCOLOR); + dc.bg[1] = getcolor(SELBGCOLOR); + dc.fg[1] = getcolor(SELFGCOLOR); setfont(FONT); wa.override_redirect = 1; -- cgit v1.2.3