summary refs log tree commit diff
path: root/conf.c
diff options
context:
space:
mode:
authorokan <okan>2011-09-03 09:25:39 +0000
committerokan <okan>2011-09-03 09:25:39 +0000
commit325129c6baa2aca0cadbdb965fcdb520fc7d3912 (patch)
tree248990d78c7ab6d033bafa96a300503ba420c184 /conf.c
parent142a36a0c0448ef9c9f7eb36068d45dce09839a9 (diff)
downloadcwm-325129c6baa2aca0cadbdb965fcdb520fc7d3912.tar.gz
cwm-325129c6baa2aca0cadbdb965fcdb520fc7d3912.tar.xz
cwm-325129c6baa2aca0cadbdb965fcdb520fc7d3912.zip
simplify color initialization.
ok oga@
Diffstat (limited to 'conf.c')
-rw-r--r--conf.c25
1 files changed, 12 insertions, 13 deletions
diff --git a/conf.c b/conf.c
index f44113a..5c921a4 100644
--- a/conf.c
+++ b/conf.c
@@ -65,6 +65,15 @@ conf_font(struct conf *c, struct screen_ctx *sc)
 	sc->font = font_make(sc, c->font);
 }
 
+static struct color color_binds[] = {
+	{ "#CCCCCC",	0 }, /* CWM_COLOR_BORDOR_ACTIVE */
+	{ "#666666",	0 }, /* CWM_COLOR_BORDOR_INACTIVE */
+	{ "blue",	0 }, /* CWM_COLOR_BORDOR_GROUP */
+	{ "red",	0 }, /* CWM_COLOR_BORDOR_UNGROUP */
+	{ "black",	0 }, /* CWM_COLOR_FG_MENU */
+	{ "white",	0 }, /* CWM_COLOR_BG_MENU */
+};
+
 void
 conf_color(struct conf *c, struct screen_ctx *sc)
 {
@@ -191,23 +200,13 @@ conf_init(struct conf *c)
 	for (i = 0; i < nitems(m_binds); i++)
 		conf_mousebind(c, m_binds[i].key, m_binds[i].func);
 
+	for (i = 0; i < nitems(color_binds); i++)
+		c->color[i].name = xstrdup(color_binds[i].name);
+
 	/* Default term/lock */
 	(void)strlcpy(c->termpath, "xterm", sizeof(c->termpath));
 	(void)strlcpy(c->lockpath, "xlock", sizeof(c->lockpath));
 
-	c->color[CWM_COLOR_BORDER_ACTIVE].name =
-	    xstrdup(CONF_COLOR_ACTIVEBORDER);
-	c->color[CWM_COLOR_BORDER_INACTIVE].name =
-	    xstrdup(CONF_COLOR_INACTIVEBORDER);
-	c->color[CWM_COLOR_BORDER_GROUP].name =
-	    xstrdup(CONF_COLOR_GROUPBORDER);
-	c->color[CWM_COLOR_BORDER_UNGROUP].name =
-	    xstrdup(CONF_COLOR_UNGROUPBORDER);
-	c->color[CWM_COLOR_FG_MENU].name =
-	    xstrdup(CONF_COLOR_MENUFG);
-	c->color[CWM_COLOR_BG_MENU].name =
-	    xstrdup(CONF_COLOR_MENUBG);
-
 	c->font = xstrdup(CONF_FONT);
 }