- CComponentsHeader: add possibility to change font in header class

This commit is contained in:
svenhoefer
2013-05-28 10:24:23 +02:00
parent 1e0df8842e
commit 890d282315
2 changed files with 9 additions and 2 deletions

View File

@@ -148,6 +148,7 @@ class CComponentsHeader : public CComponentsForm
virtual void setCaption(const std::string& caption); virtual void setCaption(const std::string& caption);
virtual void setCaption(neutrino_locale_t caption_locale); 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 setCaptionColor(fb_pixel_t text_color){cch_col_text = text_color;};
virtual void setButtonOffset(const int offset){cch_btn_offset = offset;}; virtual void setButtonOffset(const int offset){cch_btn_offset = offset;};
virtual void setIcon(const char* icon_name); virtual void setIcon(const char* icon_name);

View File

@@ -51,7 +51,7 @@ CComponentsHeader::CComponentsHeader( const int x_pos, const int y_pos, const in
x = x_pos; x = x_pos;
y = y_pos; y = y_pos;
width = w; width = w;
height = h > 0 ? h : g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight(); height = h > 0 ? h : height;
shadow = has_shadow; shadow = has_shadow;
col_frame = color_frame; col_frame = color_frame;
col_body = color_body; col_body = color_body;
@@ -74,7 +74,7 @@ CComponentsHeader::CComponentsHeader( const int x_pos, const int y_pos, const in
x = x_pos; x = x_pos;
y = y_pos; y = y_pos;
width = w; width = w;
height = h; height = h > 0 ? h : height;
shadow = has_shadow; shadow = has_shadow;
col_frame = color_frame; col_frame = color_frame;
col_body = color_body; col_body = color_body;
@@ -139,6 +139,12 @@ void CComponentsHeader::setCaption(neutrino_locale_t caption_locale)
cch_text = g_Locale->getText(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) void CComponentsHeader::setIcon(const char* icon_name)
{ {
cch_icon_name = icon_name; cch_icon_name = icon_name;