summaryrefslogtreecommitdiff
path: root/app/cwm/font.c
diff options
context:
space:
mode:
Diffstat (limited to 'app/cwm/font.c')
-rw-r--r--app/cwm/font.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/app/cwm/font.c b/app/cwm/font.c
index 7268b7ec6..75d568662 100644
--- a/app/cwm/font.c
+++ b/app/cwm/font.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: font.c,v 1.21 2012/12/17 02:28:45 okan Exp $
+ * $OpenBSD: font.c,v 1.22 2012/12/17 02:53:29 okan Exp $
*/
#include <sys/param.h>
@@ -51,8 +51,8 @@ font_height(struct screen_ctx *sc)
void
font_init(struct screen_ctx *sc, const char *name, const char **color)
{
- int i;
- XRenderColor c;
+ int i;
+ XRenderColor c;
sc->xftdraw = XftDrawCreate(X_Dpy, sc->rootwin,
DefaultVisual(X_Dpy, sc->which), DefaultColormap(X_Dpy, sc->which));
@@ -62,7 +62,8 @@ font_init(struct screen_ctx *sc, const char *name, const char **color)
sc->font = XftFontOpenName(X_Dpy, sc->which, name);
if (sc->font == NULL)
errx(1, "XftFontOpenName");
- for(i = 0; i < CWM_COLOR_MENU_MAX; i++) {
+
+ for (i = 0; i < CWM_COLOR_MENU_MAX; i++) {
if (*color[i] == '\0')
break;
if (!XftColorAllocName(X_Dpy, DefaultVisual(X_Dpy, sc->which),
@@ -74,11 +75,11 @@ font_init(struct screen_ctx *sc, const char *name, const char **color)
return;
xu_xorcolor(sc->xftcolor[CWM_COLOR_MENU_BG].color,
- sc->xftcolor[CWM_COLOR_MENU_FG].color, &c);
+ sc->xftcolor[CWM_COLOR_MENU_FG].color, &c);
xu_xorcolor(sc->xftcolor[CWM_COLOR_MENU_FONT].color, c, &c);
if (!XftColorAllocValue(X_Dpy, DefaultVisual(X_Dpy, sc->which),
- DefaultColormap(X_Dpy, sc->which), &c,
- &sc->xftcolor[CWM_COLOR_MENU_FONT_SEL]))
+ DefaultColormap(X_Dpy, sc->which), &c,
+ &sc->xftcolor[CWM_COLOR_MENU_FONT_SEL]))
errx(1, "XftColorAllocValue");
}
@@ -97,7 +98,7 @@ void
font_draw(struct screen_ctx *sc, const char *text, int len,
Drawable d, int active, int x, int y)
{
- int color;
+ int color;
color = active ? CWM_COLOR_MENU_FONT_SEL : CWM_COLOR_MENU_FONT;
XftDrawChange(sc->xftdraw, d);