From 63fbdaae1f43b9e9a43f488f914b1135d2229378 Mon Sep 17 00:00:00 2001 From: Andrzej Rybczak Date: Sat, 10 Oct 2009 12:04:52 +0200 Subject: [PATCH] ignore width of last column and use all remained space for it --- src/display.cpp | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/display.cpp b/src/display.cpp index 12d6ae44..a5b86b83 100644 --- a/src/display.cpp +++ b/src/display.cpp @@ -38,7 +38,13 @@ std::string Display::Columns() for (std::vector::const_iterator it = Config.columns.begin(); it != Config.columns.end(); ++it) { - width = last_fixed && it == next2last ? COLS-where-(++next2last)->width : (it->width*(it->fixed ? 1 : COLS/100.0)); + width = (last_fixed && it == next2last + ? COLS-where-(++next2last)->width + : (it == Config.columns.end()-1 + ? COLS-where + : (it->width*(it->fixed ? 1 : COLS/100.0)) + ) + ); switch (it->type) { @@ -130,7 +136,14 @@ void Display::SongsInColumns(const MPD::Song &s, void *, Menu *menu) *menu << clEnd; } - width = last_fixed && it == next2last ? COLS-where-(++next2last)->width : (it->width*(it->fixed ? 1 : COLS/100.0)); + width = (last_fixed && it == next2last + ? COLS-where-(++next2last)->width + : (it == Config.columns.end()-1 + ? menu->GetWidth()-where + : (it->width*(it->fixed ? 1 : COLS/100.0)) + ) + ); + MPD::Song::GetFunction get = 0; switch (it->type)