Add vertical padding to the status bar as well

For symmetry, if for nothing else.
This commit is contained in:
Přemysl Eric Janouch 2023-07-23 15:35:58 +02:00
parent 9ab5ab6928
commit 48fc9bdb19
Signed by: p
GPG Key ID: A0420B94F92B9493

View File

@ -1616,7 +1616,7 @@ app_append_layout (struct layout *l, struct layout *dest)
{
// Assuming there is no unclaimed vertical space.
LIST_FOR_EACH (struct widget, w, l->head)
widget_move (w, 0, last->y + last->height - w->y);
widget_move (w, 0, last->y + last->height);
last->next = l->head;
l->head->prev = last;
@ -1913,20 +1913,22 @@ app_layout_tabs (struct layout *out)
app_flush_layout (&l, out);
}
static void
app_layout_padding (chtype attrs, struct layout *out)
{
struct layout l = {};
app_push_fill (&l, g.ui->padding (attrs, 0, 0.125));
app_flush_layout (&l, out);
}
static void
app_layout_header (struct layout *out)
{
if (g.client.state == MPD_CONNECTED)
{
struct layout lt = {};
app_push_fill (&lt, g.ui->padding (APP_ATTR (NORMAL), 0, 0.125));
app_flush_layout (&lt, out);
app_layout_padding (APP_ATTR (NORMAL), out);
app_layout_status (out);
struct layout lb = {};
app_push_fill (&lb, g.ui->padding (APP_ATTR (NORMAL), 0, 0.125));
app_flush_layout (&lb, out);
app_layout_padding (APP_ATTR (NORMAL), out);
}
app_layout_tabs (out);
@ -2136,8 +2138,10 @@ app_layout_mpd_status (struct layout *out)
static void
app_layout_statusbar (struct layout *out)
{
struct layout l = {};
chtype attrs[2] = { APP_ATTR (NORMAL), APP_ATTR (HIGHLIGHT) };
app_layout_padding (attrs[0], out);
struct layout l = {};
if (g.message)
{
app_push (&l, g.ui->padding (attrs[0], 0.25, 1));
@ -2167,6 +2171,8 @@ app_layout_statusbar (struct layout *out)
app_layout_text ("Connecting to MPD...", attrs[0], out);
else if (g.client.state == MPD_DISCONNECTED)
app_layout_text ("Disconnected", attrs[0], out);
app_layout_padding (attrs[0], out);
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -