neutrino: implement CMenuSeparator::getString() in menue

this fixes the menu autosize issues with strings in menu separators

git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-experimental@241 e54a6e83-5905-42d5-8d5c-058d10e6a962
This commit is contained in:
seife
2010-01-31 17:04:52 +00:00
parent 3c805e7a7a
commit 09db30e5ed
2 changed files with 10 additions and 9 deletions

View File

@@ -1304,12 +1304,15 @@ int CMenuSeparator::getHeight(void) const
int CMenuSeparator::getWidth(void) const
{
return 0;
}
const char * CMenuSeparator::getString(void)
{
return g_Locale->getText(text);
int w = 0;
if (type & LINE)
w = 30; /* 15 pixel left and right */
if ((type & STRING) && text != NONEXISTANT_LOCALE)
{
const char *l_text = g_Locale->getText(text);
w += g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(l_text, true);
}
return w;
}
int CMenuSeparator::paint(bool selected, bool /*last*/)
@@ -1331,7 +1334,7 @@ int CMenuSeparator::paint(bool selected, bool /*last*/)
{
int stringstartposX;
const char * l_text = getString();
const char *l_text = g_Locale->getText(text);
int stringwidth = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(l_text, true); // UTF-8
/* if no alignment is specified, align centered */