CAudioPlayerGui: paint of id3 info with info box

Infobox provides already paint of text, so is not required to
call explicit fontrenderer methods.
This commit is contained in:
2014-12-26 18:02:31 +01:00
parent 32af48cc80
commit 98d18f3ff4

View File

@@ -1825,10 +1825,6 @@ void CAudioPlayerGui::paintItemID3DetailsLine (int pos)
if (dline != NULL) if (dline != NULL)
dline->kill(); dline->kill();
// clear infobox
if (ibox != NULL)
ibox->kill();
// paint Line if detail info (and not valid list pos) and info box // paint Line if detail info (and not valid list pos) and info box
if (!m_playlist.empty() && (pos >= 0)) if (!m_playlist.empty() && (pos >= 0))
{ {
@@ -1839,39 +1835,41 @@ void CAudioPlayerGui::paintItemID3DetailsLine (int pos)
dline->paint(false); dline->paint(false);
// paint id3 infobox // paint id3 infobox
if (ibox == NULL) if (ibox == NULL){
ibox = new CComponentsInfoBox(m_x, ypos2, m_width, m_info_height); ibox = new CComponentsInfoBox(m_x, ypos2, m_width, m_info_height);
ibox->setFrameThickness(2);
ibox->setCorner(RADIUS_LARGE); ibox->setCorner(RADIUS_LARGE);
ibox->setYPos(ypos2); ibox->setYPos(ypos2);
ibox->setColorBody(COL_MENUCONTENTDARK_PLUS_0); ibox->setColorBody(COL_MENUCONTENTDARK_PLUS_0);
ibox->setFrameThickness(2); ibox->forceTextPaint(false);
ibox->paint(false); }
g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(m_x + 10, ypos2 + 2 + 1*m_fheight, m_width- 80, //title
m_playlist[m_selected].MetaData.title, COL_MENUCONTENTDARK_TEXT); std::string text_info = m_playlist[m_selected].MetaData.title;
std::string tmp;
//date, genre
if (m_playlist[m_selected].MetaData.genre.empty()) if (m_playlist[m_selected].MetaData.genre.empty())
tmp = m_playlist[m_selected].MetaData.date; text_info = m_playlist[m_selected].MetaData.date;
else if (m_playlist[m_selected].MetaData.date.empty()) else if (m_playlist[m_selected].MetaData.date.empty())
tmp = m_playlist[m_selected].MetaData.genre; text_info = m_playlist[m_selected].MetaData.genre;
else else
{ {
tmp = m_playlist[m_selected].MetaData.genre; text_info = m_playlist[m_selected].MetaData.genre;
tmp += " / "; text_info += " / ";
tmp += m_playlist[m_selected].MetaData.date; text_info += m_playlist[m_selected].MetaData.date;
} }
int w = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(tmp) + 10;
g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(m_x + m_width - w - 5, ypos2 + 2 + 1*m_fheight, //artist, album
w, tmp, COL_MENUCONTENTDARK_TEXT); text_info = m_playlist[m_selected].MetaData.artist;
tmp = m_playlist[m_selected].MetaData.artist;
if (!(m_playlist[m_selected].MetaData.album.empty())) if (!(m_playlist[m_selected].MetaData.album.empty()))
{ {
tmp += " ("; text_info += " (";
tmp += m_playlist[m_selected].MetaData.album; text_info += m_playlist[m_selected].MetaData.album;
tmp += ')'; text_info += ')';
} }
g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(m_x + 10, ypos2 + 2*m_fheight - 2, m_width - 20,
tmp, COL_MENUCONTENTDARK_TEXT); ibox->setText(text_info, CTextBox::AUTO_WIDTH, g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO], COL_MENUCONTENT_TEXT);
ibox->paint(false);
} }
else else
{ {