aboutsummaryrefslogtreecommitdiffstats
path: root/menu.c
diff options
context:
space:
mode:
authorokan2009-05-17 23:40:57 +0000
committerokan2009-05-17 23:40:57 +0000
commita83ec02263f57eac22f091d37c7e678aed7b8d38 (patch)
tree4b34676783c097eb00c55658b30e6c56c0fc8267 /menu.c
parent915104a67e5e6fc2c55c6a44b9360c290ea2e61d (diff)
downloadcwm-a83ec02263f57eac22f091d37c7e678aed7b8d38.tar.gz
a long time coming - re-work the way we deal with colors: since we're
using Xft(3), use it to select the font color as well instead of trying to build one; properly allocate and free colors at-will, e.g. we now have configurable colors. feedback and ok's todd@ and oga@
Diffstat (limited to 'menu.c')
-rw-r--r--menu.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/menu.c b/menu.c
index 7d0e1d8..f8c8abc 100644
--- a/menu.c
+++ b/menu.c
@@ -58,8 +58,19 @@ static int menu_calc_entry(struct screen_ctx *, struct menu_ctx *,
void
menu_init(struct screen_ctx *sc)
{
- sc->menuwin = XCreateSimpleWindow(X_Dpy, sc->rootwin, 0, 0,
- 1, 1, 1, sc->blackpixl, sc->whitepixl);
+ XGCValues gv;
+
+ sc->menuwin = XCreateSimpleWindow(X_Dpy, sc->rootwin, 0, 0, 1, 1, 0,
+ sc->color[CWM_COLOR_BG_MENU].pixel,
+ sc->color[CWM_COLOR_BG_MENU].pixel);
+
+ gv.foreground =
+ sc->color[CWM_COLOR_FG_MENU].pixel^sc->color[CWM_COLOR_BG_MENU].pixel;
+ gv.background = sc->color[CWM_COLOR_BG_MENU].pixel;
+ gv.function = GXxor;
+
+ sc->gc = XCreateGC(X_Dpy, sc->menuwin,
+ GCForeground|GCBackground|GCFunction, &gv);
}
struct menu *