From 066f93f7719e2667a64ac983db612410d7d55916 Mon Sep 17 00:00:00 2001 From: okan Date: Wed, 1 Jul 2015 14:36:42 +0000 Subject: style --- menu.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'menu.c') diff --git a/menu.c b/menu.c index c9106e8..dd050ca 100644 --- a/menu.c +++ b/menu.c @@ -16,7 +16,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $OpenBSD: menu.c,v 1.85 2015/06/30 18:42:50 okan Exp $ + * $OpenBSD: menu.c,v 1.86 2015/07/01 14:36:42 okan Exp $ */ #include @@ -411,8 +411,7 @@ menu_draw(struct menu_ctx *mc, struct menu_q *menuq, struct menu_q *resultq) n = 0; TAILQ_FOREACH(mi, resultq, resultentry) { - char *text = mi->print[0] != '\0' ? - mi->print : mi->text; + char *text = (mi->print[0] != '\0') ? mi->print : mi->text; int y = n * (sc->xftfont->height + 1) + sc->xftfont->ascent + 1; /* Stop drawing when menu doesn't fit inside the screen. */ @@ -444,12 +443,12 @@ menu_draw_entry(struct menu_ctx *mc, struct menu_q *resultq, if (mi == NULL) return; - color = active ? CWM_COLOR_MENU_FG : CWM_COLOR_MENU_BG; - text = mi->print[0] != '\0' ? mi->print : mi->text; + color = (active) ? CWM_COLOR_MENU_FG : CWM_COLOR_MENU_BG; + text = (mi->print[0] != '\0') ? mi->print : mi->text; XftDrawRect(sc->xftdraw, &sc->xftcolor[color], 0, (sc->xftfont->height + 1) * entry, mc->geom.w, (sc->xftfont->height + 1) + sc->xftfont->descent); - color = active ? CWM_COLOR_MENU_FONT_SEL : CWM_COLOR_MENU_FONT; + color = (active) ? CWM_COLOR_MENU_FONT_SEL : CWM_COLOR_MENU_FONT; xu_xft_draw(sc, text, color, 0, (sc->xftfont->height + 1) * entry + sc->xftfont->ascent + 1); } -- cgit v1.2.3-2-gb3c3