Code

screen_play: Fixed the scrolling in the playlist screen.
authorPatrick Hallen <patrick.hallen@rwth-aachen.de>
Fri, 4 Sep 2009 21:00:54 +0000 (23:00 +0200)
committerPatrick Hallen <patrick.hallen@rwth-aachen.de>
Fri, 4 Sep 2009 21:00:54 +0000 (23:00 +0200)
Since commit 850ad87b588dd6cbb96e5558ee671f2c95cc839d, which introduced
a second column with the length of the song in the playlist screen, scrolling
of the entries would sometimes not work, if the entry was smaller than the
screen, but bigger than the first column.
This easy patch fixes this by using the real size of the first column to decide
whether to start scrolling.

src/screen_play.c

index fe9b5c2659ca6ecab6c9860588ab8181377026d3..46ad68eb24dead84bafa53c51bd8fe6c3505d2e6 100644 (file)
@@ -129,7 +129,7 @@ list_callback(unsigned idx, bool *highlight, char **second_column, G_GNUC_UNUSED
 
        if (idx == lw->selected)
        {
-               if (options.scroll && utf8_width(songname) > (unsigned)COLS)
+               if (options.scroll && utf8_width(songname) > (unsigned)(COLS - strlen(*second_column) - 1) )
                {
                        static unsigned current_song;
                        char *tmp;