mirror of
https://github.com/clangen/musikcube.git
synced 2024-11-19 11:10:52 +00:00
Fixed a crash in NowPlayingLayout's tracklist formatter when the window
gets very small.
This commit is contained in:
parent
8ec23765fd
commit
89b4c06fb0
@ -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")
|
||||
|
@ -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")
|
||||
|
Loading…
Reference in New Issue
Block a user