- fonts: add and use own font for all footers

This commit is contained in:
svenhoefer
2016-08-15 18:54:28 +02:00
parent 080cda9716
commit 54f2ac510f
26 changed files with 46 additions and 40 deletions

View File

@@ -262,7 +262,7 @@ void CFileBrowser::fontInit()
{
fnt_title = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE];
fnt_item = g_Font[SNeutrinoSettings::FONT_TYPE_FILEBROWSER_ITEM];
fnt_small = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL];
fnt_foot = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_FOOT];
width = frameBuffer->getScreenWidthRel();
height = frameBuffer->getScreenHeightRel();
x = getScreenStartX(width);
@@ -271,7 +271,7 @@ void CFileBrowser::fontInit()
fheight = fnt_item->getHeight();
if (fheight == 0)
fheight = 1; /* avoid div by zero on invalid font */
//foheight = fnt_small->getHeight()+6; //initial height value for buttonbar; TODO get value from buttonbar
//foheight = fnt_foot->getHeight()+6; //initial height value for buttonbar; TODO get value from buttonbar
foheight = paintFoot(false);
skwidth = 26;
@@ -1374,10 +1374,10 @@ int CFileBrowser::paintFoot(bool show)
std::string sort_text = g_Locale->getText(LOCALE_MOVIEBROWSER_FOOT_SORT);
sort_text += g_Locale->getText(sortByNames[g_settings.filebrowser_sortmethod]);
int sort_text_len = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getRenderWidth(g_Locale->getText(LOCALE_MOVIEBROWSER_FOOT_SORT));
int sort_text_len = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_FOOT]->getRenderWidth(g_Locale->getText(LOCALE_MOVIEBROWSER_FOOT_SORT));
int len = 0;
for (int i = 0; i < FILEBROWSER_NUMBER_OF_SORT_VARIANTS; i++)
len = std::max(len, g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getRenderWidth(g_Locale->getText(sortByNames[i])));
len = std::max(len, g_Font[SNeutrinoSettings::FONT_TYPE_MENU_FOOT]->getRenderWidth(g_Locale->getText(sortByNames[i])));
sort_text_len += len;
@@ -1429,7 +1429,7 @@ int CFileBrowser::paintFoot(bool show)
void CFileBrowser::paintSMSKey()
{
int skheight = fnt_small->getHeight();
int skheight = fnt_foot->getHeight();
//background
frameBuffer->paintBoxRel(x + width - skwidth, y + height - foheight, skwidth, foheight, COL_MENUFOOT_PLUS_0, RADIUS_MID, CORNER_BOTTOM_RIGHT);
@@ -1438,8 +1438,8 @@ void CFileBrowser::paintSMSKey()
{
char cKey[2] = {m_SMSKeyInput.getOldKey(), 0};
cKey[0] = toupper(cKey[0]);
int len = fnt_small->getRenderWidth(cKey);
fnt_small->RenderString(x + width - skwidth, y + height - foheight + foheight/2 + skheight/2, len, cKey, COL_MENUHEAD_TEXT);
int len = fnt_foot->getRenderWidth(cKey);
fnt_foot->RenderString(x + width - skwidth, y + height - foheight + foheight/2 + skheight/2, len, cKey, COL_MENUHEAD_TEXT);
}
}