From: Max Kellermann Date: Sun, 11 Oct 2009 17:41:08 +0000 (+0200) Subject: screen_queue: use paint_song_row() X-Git-Tag: release-0.16~105 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=273d49860104e7696496e8bc68f29c3819ee9ff6;p=ncmpc.git screen_queue: use paint_song_row() Reuse code from screen_browser.c. Side effect: this patch disables horizontal scrolling. The "hscroll" library will return after an overhaul. --- diff --git a/src/screen_queue.c b/src/screen_queue.c index 750e940..b36ba66 100644 --- a/src/screen_queue.c +++ b/src/screen_queue.c @@ -30,7 +30,7 @@ #include "utils.h" #include "strfsong.h" #include "wreadln.h" -#include "colors.h" +#include "song_paint.h" #include "screen.h" #include "screen_utils.h" #include "screen_song.h" @@ -543,10 +543,27 @@ screen_queue_title(char *str, size_t size) return str; } +static void +screen_queue_paint_callback(WINDOW *w, unsigned i, + unsigned y, unsigned width, + bool selected, G_GNUC_UNUSED void *data) +{ + const struct mpd_song *song; + + assert(playlist != NULL); + assert(i < playlist_length(playlist)); + + song = playlist_get(playlist, i); + + paint_song_row(w, y, width, selected, + (int)mpd_song_get_id(song) == current_song_id, + song); +} + static void screen_queue_paint(void) { - list_window_paint(lw, screen_queue_lw_callback, NULL); + list_window_paint2(lw, screen_queue_paint_callback, NULL); } G_GNUC_PURE