aboutsummaryrefslogtreecommitdiffstats
path: root/conf.c
diff options
context:
space:
mode:
authorokan2012-12-17 02:28:45 +0000
committerokan2012-12-17 02:28:45 +0000
commit413da1eebb4612d1fe0c55b2b9a5957b5379285d (patch)
treed4ab320aa75fefece4189a84bf0e697503416b9e /conf.c
parent168c81d59eaf5d21c57d30f3ddb5674168a753f8 (diff)
downloadcwm-413da1eebb4612d1fe0c55b2b9a5957b5379285d.tar.gz
non-trivial menu drawing rewrite, moving to Xft and solving various
font/color drawing issues; from Alexander Polakov
Diffstat (limited to 'conf.c')
-rw-r--r--conf.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/conf.c b/conf.c
index 9d9fc77..a7b00a3 100644
--- a/conf.c
+++ b/conf.c
@@ -15,7 +15,7 @@
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
- * $OpenBSD: conf.c,v 1.110 2012/11/28 14:14:44 okan Exp $
+ * $OpenBSD: conf.c,v 1.111 2012/12/17 02:28:45 okan Exp $
*/
#include <sys/param.h>
@@ -62,17 +62,21 @@ conf_gap(struct conf *c, struct screen_ctx *sc)
void
conf_font(struct conf *c, struct screen_ctx *sc)
{
- font_init(sc, c->font, c->color[CWM_COLOR_FONT].name);
+ font_init(sc, c->font, (const char**)c->menucolor);
}
-static struct color color_binds[] = {
+static char *menu_color_binds[CWM_COLOR_MENU_MAX] = {
+ "black", /* CWM_COLOR_MENU_FG */
+ "white", /* CWM_COLOR_MENU_BG */
+ "black", /* CWM_COLOR_MENU_FONT */
+ "", /* CWM_COLOR_MENU_FONT_SEL */
+};
+
+static struct color color_binds[CWM_COLOR_MAX] = {
{ "#CCCCCC", 0 }, /* CWM_COLOR_BORDER_ACTIVE */
{ "#666666", 0 }, /* CWM_COLOR_BORDER_INACTIVE */
{ "blue", 0 }, /* CWM_COLOR_BORDER_GROUP */
{ "red", 0 }, /* CWM_COLOR_BORDER_UNGROUP */
- { "black", 0 }, /* CWM_COLOR_FG_MENU */
- { "white", 0 }, /* CWM_COLOR_BG_MENU */
- { "black", 0 }, /* CWM_COLOR_FONT */
};
void
@@ -182,6 +186,9 @@ conf_init(struct conf *c)
for (i = 0; i < nitems(color_binds); i++)
c->color[i].name = xstrdup(color_binds[i].name);
+ for (i = 0; i < nitems(menu_color_binds); i++)
+ c->menucolor[i] = xstrdup(menu_color_binds[i]);
+
/* Default term/lock */
(void)strlcpy(c->termpath, "xterm", sizeof(c->termpath));
(void)strlcpy(c->lockpath, "xlock", sizeof(c->lockpath));