summaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorAnselm R. Garbe <arg@10kloc.org>2006-08-25 14:45:17 +0200
committerAnselm R. Garbe <arg@10kloc.org>2006-08-25 14:45:17 +0200
commit13ef97e65ea5a713a3d5ab46916d1ac6d071b825 (patch)
treeb8a9f831677cbd40cc27e1f0c8bf313b7e04addb /main.c
parent65be999a3f76ad51fb97e12f2fb481f5038f6817 (diff)
updated dmenu to borderless drawing as well
Diffstat (limited to 'main.c')
-rw-r--r--main.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/main.c b/main.c
index 840a7bc..51fa20f 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, dc.norm);
/* print command */
if(cmdw && item)
dc.w = cmdw;
- drawtext(text[0] ? text : NULL, False, False);
+ drawtext(text[0] ? text : NULL, dc.norm);
dc.x += cmdw;
if(curr) {
dc.w = SPACE;
- drawtext((curr && curr->left) ? "<" : NULL, False, False);
+ drawtext((curr && curr->left) ? "<" : NULL, dc.norm);
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) ? dc.sel : dc.norm);
dc.x += dc.w;
}
dc.x = mw - SPACE;
dc.w = SPACE;
- drawtext(next ? ">" : NULL, False, False);
+ drawtext(next ? ">" : NULL, dc.norm);
}
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.sel[ColBG] = getcolor(SELBGCOLOR);
+ dc.sel[ColFG] = getcolor(SELFGCOLOR);
+ dc.norm[ColBG] = getcolor(NORMBGCOLOR);
+ dc.norm[ColFG] = getcolor(NORMFGCOLOR);
setfont(FONT);
wa.override_redirect = 1;
@@ -326,7 +327,7 @@ main(int argc, char *argv[])
mx = my = 0;
mw = DisplayWidth(dpy, screen);
- mh = dc.font.height + 4;
+ mh = dc.font.height + 2;
win = XCreateWindow(dpy, root, mx, my, mw, mh, 0,
DefaultDepth(dpy, screen), CopyFromParent,