diff --git a/src/gui/components/cc_frm.h b/src/gui/components/cc_frm.h index 7ff1c504e..b12ef91bf 100644 --- a/src/gui/components/cc_frm.h +++ b/src/gui/components/cc_frm.h @@ -148,6 +148,7 @@ class CComponentsHeader : public CComponentsForm virtual void setCaption(const std::string& caption); virtual void setCaption(neutrino_locale_t caption_locale); + virtual void setCaptionFont(Font* font_name); virtual void setCaptionColor(fb_pixel_t text_color){cch_col_text = text_color;}; virtual void setButtonOffset(const int offset){cch_btn_offset = offset;}; virtual void setIcon(const char* icon_name); diff --git a/src/gui/components/cc_frm_header.cpp b/src/gui/components/cc_frm_header.cpp index 2bc3f99ab..4a35876e4 100644 --- a/src/gui/components/cc_frm_header.cpp +++ b/src/gui/components/cc_frm_header.cpp @@ -51,7 +51,7 @@ CComponentsHeader::CComponentsHeader( const int x_pos, const int y_pos, const in x = x_pos; y = y_pos; width = w; - height = h > 0 ? h : g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight(); + height = h > 0 ? h : height; shadow = has_shadow; col_frame = color_frame; col_body = color_body; @@ -74,7 +74,7 @@ CComponentsHeader::CComponentsHeader( const int x_pos, const int y_pos, const in x = x_pos; y = y_pos; width = w; - height = h; + height = h > 0 ? h : height; shadow = has_shadow; col_frame = color_frame; col_body = color_body; @@ -139,6 +139,12 @@ void CComponentsHeader::setCaption(neutrino_locale_t caption_locale) cch_text = g_Locale->getText(caption_locale); } +void CComponentsHeader::setCaptionFont(Font* font_name) +{ + cch_font = font_name; + height = std::max(height, cch_font->getHeight()); +} + void CComponentsHeader::setIcon(const char* icon_name) { cch_icon_name = icon_name;