Nicer playlist

This commit is contained in:
Přemysl Eric Janouch 2016-10-13 02:03:32 +02:00
parent a8deb3c218
commit 62ac29993e
Signed by: p
GPG Key ID: B715679E3A361BE6
1 changed files with 9 additions and 2 deletions

View File

@ -1974,8 +1974,15 @@ current_tab_on_item_draw (size_t item_index, struct row_buffer *buffer,
{ {
// TODO: better output // TODO: better output
compact_map_t map = item_list_get (&g_ctx.playlist, item_index); compact_map_t map = item_list_get (&g_ctx.playlist, item_index);
row_buffer_append (buffer, compact_map_find (map, "file"), const char *artist = compact_map_find (map, "artist");
(int) item_index == g_ctx.song ? A_BOLD : 0); const char *title = compact_map_find (map, "title");
chtype attrs = (int) item_index == g_ctx.song ? A_BOLD : 0;
if (artist && title)
row_buffer_addv (buffer,
artist, attrs, " - ", attrs, title, attrs, NULL);
else
row_buffer_append (buffer, compact_map_find (map, "file"), attrs);
} }
static bool static bool