]> git.corax.cc Git - mwm/commitdiff
monitor: Draw the background of the status bar in the background color
authorMatthias Kruk <m@m10k.eu>
Sun, 23 May 2021 22:00:24 +0000 (07:00 +0900)
committerMatthias Kruk <m@m10k.eu>
Sun, 23 May 2021 22:00:24 +0000 (07:00 +0900)
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

index fa773e7f99a679e2db0770dbce0c9c292871b813..5ff7352e42bd72530029f8bf038987adfe41262e 100644 (file)
--- 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);