|
|
@ -77,17 +77,17 @@ drawmenu() |
|
|
|
dc.y = 0; |
|
|
|
dc.y = 0; |
|
|
|
dc.w = mw; |
|
|
|
dc.w = mw; |
|
|
|
dc.h = mh; |
|
|
|
dc.h = mh; |
|
|
|
drawtext(NULL, False, False); |
|
|
|
drawtext(NULL, dc.norm); |
|
|
|
|
|
|
|
|
|
|
|
/* print command */ |
|
|
|
/* print command */ |
|
|
|
if(cmdw && item) |
|
|
|
if(cmdw && item) |
|
|
|
dc.w = cmdw; |
|
|
|
dc.w = cmdw; |
|
|
|
drawtext(text[0] ? text : NULL, False, False); |
|
|
|
drawtext(text[0] ? text : NULL, dc.norm); |
|
|
|
dc.x += cmdw; |
|
|
|
dc.x += cmdw; |
|
|
|
|
|
|
|
|
|
|
|
if(curr) { |
|
|
|
if(curr) { |
|
|
|
dc.w = SPACE; |
|
|
|
dc.w = SPACE; |
|
|
|
drawtext((curr && curr->left) ? "<" : NULL, False, False); |
|
|
|
drawtext((curr && curr->left) ? "<" : NULL, dc.norm); |
|
|
|
dc.x += dc.w; |
|
|
|
dc.x += dc.w; |
|
|
|
|
|
|
|
|
|
|
|
/* determine maximum items */ |
|
|
|
/* determine maximum items */ |
|
|
@ -95,13 +95,13 @@ drawmenu() |
|
|
|
dc.w = textw(i->text); |
|
|
|
dc.w = textw(i->text); |
|
|
|
if(dc.w > mw / 3) |
|
|
|
if(dc.w > mw / 3) |
|
|
|
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 += dc.w; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
dc.x = mw - SPACE; |
|
|
|
dc.x = mw - SPACE; |
|
|
|
dc.w = 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); |
|
|
|
XCopyArea(dpy, dc.drawable, win, dc.gc, 0, 0, mw, mh, 0, 0); |
|
|
|
XFlush(dpy); |
|
|
|
XFlush(dpy); |
|
|
@ -315,9 +315,10 @@ main(int argc, char *argv[]) |
|
|
|
usleep(1000); |
|
|
|
usleep(1000); |
|
|
|
|
|
|
|
|
|
|
|
/* style */ |
|
|
|
/* style */ |
|
|
|
dc.bg = getcolor(BGCOLOR); |
|
|
|
dc.sel[ColBG] = getcolor(SELBGCOLOR); |
|
|
|
dc.fg = getcolor(FGCOLOR); |
|
|
|
dc.sel[ColFG] = getcolor(SELFGCOLOR); |
|
|
|
dc.border = getcolor(BORDERCOLOR); |
|
|
|
dc.norm[ColBG] = getcolor(NORMBGCOLOR); |
|
|
|
|
|
|
|
dc.norm[ColFG] = getcolor(NORMFGCOLOR); |
|
|
|
setfont(FONT); |
|
|
|
setfont(FONT); |
|
|
|
|
|
|
|
|
|
|
|
wa.override_redirect = 1; |
|
|
|
wa.override_redirect = 1; |
|
|
@ -326,7 +327,7 @@ main(int argc, char *argv[]) |
|
|
|
|
|
|
|
|
|
|
|
mx = my = 0; |
|
|
|
mx = my = 0; |
|
|
|
mw = DisplayWidth(dpy, screen); |
|
|
|
mw = DisplayWidth(dpy, screen); |
|
|
|
mh = dc.font.height + 4; |
|
|
|
mh = dc.font.height + 2; |
|
|
|
|
|
|
|
|
|
|
|
win = XCreateWindow(dpy, root, mx, my, mw, mh, 0, |
|
|
|
win = XCreateWindow(dpy, root, mx, my, mw, mh, 0, |
|
|
|
DefaultDepth(dpy, screen), CopyFromParent, |
|
|
|
DefaultDepth(dpy, screen), CopyFromParent, |
|
|
|