From bda70867ac50c35b3bb134cf408ce5ae3cf0c751 Mon Sep 17 00:00:00 2001 From: N-R-K <79544946+N-R-K@users.noreply.github.com> Date: Sat, 26 Feb 2022 16:38:53 +0000 Subject: add config.h option for top statusbar (#231) Closes: https://github.com/nsxiv/nsxiv/issues/230 Co-authored-by: mamg22 <45301823+mamg22@users.noreply.github.com> --- window.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'window.c') diff --git a/window.c b/window.c index a305353..7d82975 100644 --- a/window.c +++ b/window.c @@ -159,6 +159,7 @@ void win_init(win_t *win) win->bar.r.buf = emalloc(win->bar.r.size + 3); win->bar.r.buf[0] = '\0'; win->bar.h = options->hide_bar ? 0 : barheight; + win->bar.top = TOP_STATUSBAR; #endif /* HAVE_LIBFONTS */ XrmDestroyDatabase(db); @@ -445,12 +446,12 @@ static void win_draw_bar(win_t *win) return; e = &win->env; - y = win->h + font->ascent + V_TEXT_PAD; + y = (win->bar.top ? 0 : win->h) + font->ascent + V_TEXT_PAD; w = win->w - 2*H_TEXT_PAD; d = XftDrawCreate(e->dpy, win->buf.pm, e->vis, e->cmap); XSetForeground(e->dpy, gc, win->bar_bg.pixel); - XFillRectangle(e->dpy, win->buf.pm, gc, 0, win->h, win->w, win->bar.h); + XFillRectangle(e->dpy, win->buf.pm, gc, 0, win->bar.top ? 0 : win->h, win->w, win->bar.h); XSetForeground(e->dpy, gc, win->win_bg.pixel); XSetBackground(e->dpy, gc, win->bar_bg.pixel); -- cgit v1.2.3-54-g00ecf