summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPřemysl Janouch <p.janouch@gmail.com>2017-06-05 01:09:55 +0200
committerPřemysl Janouch <p.janouch@gmail.com>2017-06-05 01:09:55 +0200
commit8c260c3fc3fbb58cc1bd0e30ef85de3d926236ab (patch)
tree5bb5f21752d4198c1b2048a467e57c70ba62a4eb
parenta343156930d38075e1bf4c75153ff7f4cc83b8ff (diff)
downloadnncmpp-8c260c3fc3fbb58cc1bd0e30ef85de3d926236ab.tar.gz
nncmpp-8c260c3fc3fbb58cc1bd0e30ef85de3d926236ab.tar.xz
nncmpp-8c260c3fc3fbb58cc1bd0e30ef85de3d926236ab.zip
Only display enabled options
-rw-r--r--nncmpp.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/nncmpp.c b/nncmpp.c
index d2b0b9b..1ef8343 100644
--- a/nncmpp.c
+++ b/nncmpp.c
@@ -1307,14 +1307,15 @@ app_write_mpd_status (struct row_buffer *buf)
bool single = (s = str_map_find (map, "single")) && strcmp (s, "0");
bool consume = (s = str_map_find (map, "consume")) && strcmp (s, "0");
+ // TODO: remove the conditionals once we make them clickable
chtype a[2] = { APP_ATTR (NORMAL), APP_ATTR (HIGHLIGHT) };
- row_buffer_append_args (&right,
+ if (repeat) row_buffer_append_args (&right,
" ", APP_ATTR (NORMAL), "repeat", a[repeat], NULL);
- row_buffer_append_args (&right,
+ if (random) row_buffer_append_args (&right,
" ", APP_ATTR (NORMAL), "random", a[random], NULL);
- row_buffer_append_args (&right,
+ if (single) row_buffer_append_args (&right,
" ", APP_ATTR (NORMAL), "single", a[single], NULL);
- row_buffer_append_args (&right,
+ if (consume) row_buffer_append_args (&right,
" ", APP_ATTR (NORMAL), "consume", a[consume], NULL);
row_buffer_space (buf,