fonts: add and use own font for all footers

Origin commit data
------------------
Commit: 54f2ac510f
Author: vanhofen <vanhofen@gmx.de>
Date: 2016-08-15 (Mon, 15 Aug 2016)

Origin message was:
------------------
- fonts: add and use own font for all footers
This commit is contained in:
vanhofen
2016-08-15 18:54:28 +02:00
parent e512b98ff9
commit e49ee18fb3
26 changed files with 46 additions and 40 deletions

View File

@@ -97,7 +97,7 @@ int paintButtons( const button_label_ext * const content,
int *wantedheight)
{
CFrameBuffer *frameBuffer = CFrameBuffer::getInstance();
Font * font = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL];
Font * font = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_FOOT];
int cnt = count;
int x_footer = x;
int y_footer = y;
@@ -306,7 +306,7 @@ int paintButtons( const int &x,
const std::vector<neutrino_locale_t>& /*all_buttontext_id*/)
{
CFrameBuffer *frameBuffer = CFrameBuffer::getInstance();
Font * font = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL];
Font * font = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_FOOT];
uint cnt = count;
int x_footer = x;
int y_footer = y;

View File

@@ -73,7 +73,7 @@ void CMessageBox::Init(const CMessageBox::result_ &Default, const uint32_t ShowB
ih = std::max(h, ih);
i_maxw = std::max(w, i_maxw);
}
fh = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getHeight();
fh = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_FOOT]->getHeight();
b_height = std::max(fh, ih) + 8 + (RADIUS_MID / 2);
m_bbheight = b_height + fh/2 + ButtonSpacing + SHADOW_OFFSET;
result = Default;
@@ -131,7 +131,7 @@ int CMessageBox::getButtonWidth()
neutrino_locale_t localeMsg[localeMsgCount] = {LOCALE_MESSAGEBOX_YES, LOCALE_MESSAGEBOX_NO, LOCALE_MESSAGEBOX_CANCEL, LOCALE_MESSAGEBOX_OK, LOCALE_MESSAGEBOX_BACK};
int MaxButtonTextWidth = 0;
for (int i = 0; i < localeMsgCount; i++)
MaxButtonTextWidth = std::max(g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getRenderWidth(g_Locale->getText(localeMsg[i])), MaxButtonTextWidth);
MaxButtonTextWidth = std::max(g_Font[SNeutrinoSettings::FONT_TYPE_MENU_FOOT]->getRenderWidth(g_Locale->getText(localeMsg[i])), MaxButtonTextWidth);
return MaxButtonTextWidth + i_maxw + 36 + (RADIUS_LARGE / 2);
}
@@ -180,7 +180,7 @@ void CMessageBox::paintButtons()
m_window->paintBoxRel(xpos, ypos, b_width, b_height, (CFBWindow::color_t)bgcolor, RADIUS_MID);
m_window->paintBoxFrame(xpos, ypos, b_width, b_height, 1, COL_SHADOW_PLUS_0, RADIUS_MID);
m_window->paintIcon(Buttons[i].icon, xpos + ((b_height - ih) / 2), ypos + ((b_height - ih) / 2), ih);
m_window->RenderString(g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL], xpos + iw + 17, ypos + fh + ((b_height - fh) / 2),
m_window->RenderString(g_Font[SNeutrinoSettings::FONT_TYPE_MENU_FOOT], xpos + iw + 17, ypos + fh + ((b_height - fh) / 2),
b_width - (iw + 21), Buttons[i].text, (CFBWindow::color_t)color);
xpos += b_width + ButtonDistance;
}

View File

@@ -67,7 +67,7 @@
#define MIN_WINDOW_HEIGHT 40
#define DEFAULT_TITLE_FONT g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]
#define DEFAULT_FOOT_FONT g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]
#define DEFAULT_FOOT_FONT g_Font[SNeutrinoSettings::FONT_TYPE_MENU_FOOT]
//////////////////////////////////////////////////////////////////////
// Construction/Destruction

View File

@@ -108,7 +108,7 @@ void CStringInput::init()
#endif
hheight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight();
iheight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_INFO]->getHeight();
fheight = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getHeight() + 6; // init min buttonbar height
fheight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_FOOT]->getHeight() + 6; // init min buttonbar height
input_h = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getHeight() + 2; // font height + border
input_w = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth("M") + 2; // hack font width + border
offset = 20;