From e04cbea60f6f50b902e6e4f3508456c96c8a3b53 Mon Sep 17 00:00:00 2001 From: Matthias Kruk Date: Mon, 24 May 2021 07:00:24 +0900 Subject: [PATCH] monitor: Draw the background of the status bar in the background color The background of the status bar is drawn in the focus color of the current palette, meaning that the bar has a different background color on focused and non-focused screens. This is no problem per-se, but it makes it hard to predict if a status message will be readable or not, especially if it uses colored text. This commit changes the status bar to be drawn in the background color and the focus color be used to draw a border on the left and bottom sides of the status bar. --- monitor.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/monitor.c b/monitor.c index fa773e7..5ff7352 100644 --- a/monitor.c +++ b/monitor.c @@ -530,9 +530,14 @@ static int _redraw_statusbar(struct monitor *monitor) XSetForeground(display, monitor->gfx_context, mwm_get_color(monitor->mwm, dwdata.palette, MWM_COLOR_FOCUSED)); - XFillRectangle(display, monitor->statusbar, + XDrawRectangle(display, monitor->statusbar, monitor->gfx_context, status_x, 0, - status_width, STATUSBAR_HEIGHT); + status_width, STATUSBAR_HEIGHT - 1); + XSetForeground(display, monitor->gfx_context, + mwm_get_color(monitor->mwm, dwdata.palette, MWM_COLOR_BACKGROUND)); + XFillRectangle(display, monitor->statusbar, + monitor->gfx_context, status_x + 1, 0, + status_width - 1, STATUSBAR_HEIGHT - 1); mwm_render_text(monitor->mwm, monitor->xft_context, dwdata.palette, status, status_x + dwdata.text_padding, dwdata.text_padding); -- 2.47.3