From 413da1eebb4612d1fe0c55b2b9a5957b5379285d Mon Sep 17 00:00:00 2001 From: okan Date: Mon, 17 Dec 2012 02:28:45 +0000 Subject: non-trivial menu drawing rewrite, moving to Xft and solving various font/color drawing issues; from Alexander Polakov --- parse.y | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) (limited to 'parse.y') diff --git a/parse.y b/parse.y index c45ee14..fa22814 100644 --- a/parse.y +++ b/parse.y @@ -1,4 +1,4 @@ -/* $OpenBSD: parse.y,v 1.34 2012/10/31 22:06:24 okan Exp $ */ +/* $OpenBSD: parse.y,v 1.35 2012/12/17 02:28:45 okan Exp $ */ /* * Copyright (c) 2002, 2003, 2004 Henning Brauer @@ -73,7 +73,8 @@ typedef struct { %token COLOR SNAPDIST %token ACTIVEBORDER INACTIVEBORDER %token GROUPBORDER UNGROUPBORDER -%token MENUBG MENUFG FONTCOLOR +%token MENUBG MENUFG +%token FONTCOLOR FONTSELCOLOR %token ERROR %token STRING %token NUMBER @@ -186,16 +187,20 @@ colors : ACTIVEBORDER STRING { conf->color[CWM_COLOR_BORDER_UNGROUP].name = $2; } | MENUBG STRING { - free(conf->color[CWM_COLOR_BG_MENU].name); - conf->color[CWM_COLOR_BG_MENU].name = $2; + free(conf->menucolor[CWM_COLOR_MENU_BG]); + conf->menucolor[CWM_COLOR_MENU_BG] = $2; } | MENUFG STRING { - free(conf->color[CWM_COLOR_FG_MENU].name); - conf->color[CWM_COLOR_FG_MENU].name = $2; + free(conf->menucolor[CWM_COLOR_MENU_FG]); + conf->menucolor[CWM_COLOR_MENU_FG] = $2; } | FONTCOLOR STRING { - free(conf->color[CWM_COLOR_FONT].name); - conf->color[CWM_COLOR_FONT].name = $2; + free(conf->menucolor[CWM_COLOR_MENU_FONT]); + conf->menucolor[CWM_COLOR_MENU_FONT] = $2; + } + | FONTSELCOLOR STRING { + free(conf->menucolor[CWM_COLOR_MENU_FONT_SEL]); + conf->menucolor[CWM_COLOR_MENU_FONT_SEL] = $2; } ; %% @@ -247,6 +252,7 @@ lookup(char *s) { "mousebind", MOUSEBIND}, { "moveamount", MOVEAMOUNT}, { "no", NO}, + { "selfont", FONTSELCOLOR}, { "snapdist", SNAPDIST}, { "sticky", STICKY}, { "ungroupborder", UNGROUPBORDER}, @@ -575,6 +581,9 @@ parse_config(const char *filename, struct conf *xconf) for (i = 0; i < CWM_COLOR_MAX; i++) xconf->color[i].name = conf->color[i].name; + for (i = 0; i < CWM_COLOR_MENU_MAX; i++) + xconf->menucolor[i]= conf->menucolor[i]; + xconf->font = conf->font; } -- cgit v1.2.3-2-gb3c3