CComponentsHeader: declare l_font, s_font as global

Useful for init in header sub classes. So its possible to use
other prefined size mode fonts
This commit is contained in:
2016-12-27 21:02:34 +01:00
parent 2889fbd70d
commit 4cdae3fdf6
2 changed files with 3 additions and 4 deletions

View File

@@ -96,6 +96,8 @@ void CComponentsHeader::initVarHeader( const int& x_pos, const int& y_pos, const
height = height_old = h;
cch_font = NULL;
l_font = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE];
s_font = g_Font[SNeutrinoSettings::FONT_TYPE_MENU];
cch_size_mode = CC_HEADER_SIZE_LARGE;
CNeutrinoApp::getInstance()->OnAfterSetupFonts.connect(sigc::mem_fun(this, &CComponentsHeader::resetFont));
@@ -172,9 +174,6 @@ void CComponentsHeader::resetFont()
void CComponentsHeader::initCaptionFont()
{
Font *l_font = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE];
Font *s_font = g_Font[SNeutrinoSettings::FONT_TYPE_MENU];
if (cch_font == NULL){
cch_font = (cch_size_mode == CC_HEADER_SIZE_LARGE? l_font : s_font);
//select matching height

View File

@@ -67,7 +67,7 @@ class CComponentsHeader : public CComponentsForm, public CCTextScreen
///property: caption text color, see also setCaptionColor()
fb_pixel_t cch_col_text;
///property: caption font, see also setCaptionFont()
Font* cch_font;
Font* cch_font, *l_font, *s_font;
///reset font
void resetFont();