summaryrefslogtreecommitdiff
path: root/nncmpp.c
diff options
context:
space:
mode:
authorPřemysl Eric Janouch <p@janouch.name>2023-07-23 15:35:58 +0200
committerPřemysl Eric Janouch <p@janouch.name>2023-07-23 15:36:37 +0200
commit48fc9bdb1927d0bbd52bd70c563d05bf517591cd (patch)
tree3f1a22d44611337c7c01fe5d481f18b419f8a4b2 /nncmpp.c
parent9ab5ab69286a6d06979d8a6e4395512b322eeafb (diff)
downloadnncmpp-48fc9bdb1927d0bbd52bd70c563d05bf517591cd.tar.gz
nncmpp-48fc9bdb1927d0bbd52bd70c563d05bf517591cd.tar.xz
nncmpp-48fc9bdb1927d0bbd52bd70c563d05bf517591cd.zip
Add vertical padding to the status bar as well
For symmetry, if for nothing else.
Diffstat (limited to 'nncmpp.c')
-rw-r--r--nncmpp.c26
1 files changed, 16 insertions, 10 deletions
diff --git a/nncmpp.c b/nncmpp.c
index 0d9578a..8784b88 100644
--- a/nncmpp.c
+++ b/nncmpp.c
@@ -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;
@@ -1914,19 +1914,21 @@ app_layout_tabs (struct layout *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);
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -