Fixed a crash in NowPlayingLayout's tracklist formatter when the window

gets very small.
This commit is contained in:
casey langen 2016-11-22 09:43:27 -08:00
parent 8ec23765fd
commit 89b4c06fb0
2 changed files with 5 additions and 3 deletions

View File

@ -156,7 +156,7 @@ static std::string formatWithAlbum(TrackPtr track, size_t width) {
text::AlignLeft,
ARTIST_COL_WIDTH);
size_t titleWidth =
int titleWidth =
width -
TRACK_COL_WIDTH -
DURATION_COL_WIDTH -
@ -164,10 +164,12 @@ static std::string formatWithAlbum(TrackPtr track, size_t width) {
ARTIST_COL_WIDTH -
(4 * 3); /* 3 = spacing */
titleWidth = std::max(0, titleWidth);
std::string title = text::Align(
track->GetValue(constants::Track::TITLE),
text::AlignLeft,
titleWidth);
(int) titleWidth);
return boost::str(
boost::format("%s %s %s %s %s")

View File

@ -237,7 +237,7 @@ static std::string formatWithoutAlbum(TrackPtr track, size_t width) {
std::string title = text::Align(
track->GetValue(constants::Track::TITLE),
text::AlignLeft,
titleWidth);
(int) titleWidth);
return boost::str(
boost::format("%s %s %s %s")