ignore width of last column and use all remained space for it

This commit is contained in:
Andrzej Rybczak
2009-10-10 12:04:52 +02:00
parent 8a14d08cd9
commit 63fbdaae1f

View File

@@ -38,7 +38,13 @@ std::string Display::Columns()
for (std::vector<Column>::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<MPD::Song> *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)