From 273d49860104e7696496e8bc68f29c3819ee9ff6 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sun, 11 Oct 2009 19:41:08 +0200 Subject: [PATCH] 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. --- src/screen_queue.c | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) 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 -- 2.30.2