mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-28 16:01:20 +02:00
CComponentsHeader/CComponentsFooter: prevent crash on changed font settings
Default fonts for header and footer must be handled too. After font settings changes these objects could be invalid. Default fonts have invalid pointers after font changes too. Extra reset is required.
This commit is contained in:
@@ -96,8 +96,7 @@ 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];
|
||||
initDefaultFonts();
|
||||
cch_size_mode = CC_HEADER_SIZE_LARGE;
|
||||
CNeutrinoApp::getInstance()->OnAfterSetupFonts.connect(sigc::mem_fun(this, &CComponentsHeader::resetFont));
|
||||
|
||||
@@ -167,9 +166,16 @@ void CComponentsHeader::setCaptionFont(Font* font)
|
||||
void CComponentsHeader::resetFont()
|
||||
{
|
||||
if (cch_font){
|
||||
cch_font = NULL;
|
||||
dprintf(DEBUG_DEBUG, "\033[33m[CComponentsHeader][%s - %d] reset header font \033[0m\n", __func__, __LINE__);
|
||||
cch_font = NULL;
|
||||
}
|
||||
initDefaultFonts();
|
||||
}
|
||||
|
||||
void CComponentsHeader::initDefaultFonts()
|
||||
{
|
||||
l_font = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE];
|
||||
s_font = g_Font[SNeutrinoSettings::FONT_TYPE_MENU];
|
||||
}
|
||||
|
||||
void CComponentsHeader::initCaptionFont()
|
||||
|
Reference in New Issue
Block a user