From e4b3d6aea2200096f1f318f864709254b6cb213d Mon Sep 17 00:00:00 2001 From: Andrzej Rybczak Date: Sun, 22 Aug 2010 18:40:10 +0200 Subject: [PATCH] make last column with fixed size take its whole size, not size-1 --- src/display.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/display.cpp b/src/display.cpp index 8ab49e91..91252d1a 100644 --- a/src/display.cpp +++ b/src/display.cpp @@ -88,7 +88,7 @@ std::string Display::Columns() if (it == Config.columns.end()-1) width = COLS-where; else if (last_fixed && it == next2last) - width = COLS-where-(++next2last)->width; + width = COLS-where-1-(++next2last)->width; else width = it->width*(it->fixed ? 1 : COLS/100.0); @@ -130,6 +130,9 @@ void Display::SongsInColumns(const MPD::Song &s, void *data, Menu *me if (!s.Localized()) const_cast(&s)->Localize(); + /// FIXME: This function is pure mess, it needs to be + /// rewritten and unified with Display::Columns() a bit. + bool is_now_playing = menu == myPlaylist->Items && (menu->isFiltered() ? s.GetPosition() : menu->CurrentlyDrawedPosition()) == size_t(myPlaylist->NowPlaying); if (is_now_playing) *menu << Config.now_playing_prefix; @@ -172,7 +175,7 @@ void Display::SongsInColumns(const MPD::Song &s, void *data, Menu *me if (it == Config.columns.end()-1) width = menu->GetWidth()-where; else if (last_fixed && it == next2last) - width = COLS-where-(++next2last)->width; + width = COLS-where-1-(++next2last)->width; else width = it->width*(it->fixed ? 1 : COLS/100.0);