header/footer: add overloaded versions of header class with size mode option

Size mode didn't really work. It is easier to implement
headers with with separate class constructor and other size mode
Footer works also with this  additional parameter but without additional
overloaded constructors.
This commit is contained in:
2019-04-02 16:34:56 +02:00
parent 714df8b092
commit 1c574e4a07
4 changed files with 95 additions and 53 deletions

View File

@@ -38,7 +38,7 @@ using namespace std;
CComponentsFooter::CComponentsFooter(CComponentsForm* parent):CCButtonSelect()
{
//CComponentsFooter
initVarFooter(1, 1, 0, 0, 0, parent, CC_SHADOW_OFF, COL_FRAME_PLUS_0, COL_MENUFOOT_PLUS_0, COL_SHADOW_PLUS_0);
initVarFooter(1, 1, 0, 0, 0, parent, CC_SHADOW_OFF, COL_FRAME_PLUS_0, COL_MENUFOOT_PLUS_0, COL_SHADOW_PLUS_0, CC_HEADER_SIZE_LARGE);
}
CComponentsFooter::CComponentsFooter( const int& x_pos, const int& y_pos, const int& w, const int& h,
@@ -47,10 +47,11 @@ CComponentsFooter::CComponentsFooter( const int& x_pos, const int& y_pos, const
int shadow_mode,
fb_pixel_t color_frame,
fb_pixel_t color_body,
fb_pixel_t color_shadow ):CCButtonSelect()
fb_pixel_t color_shadow,
int sizeMode):CCButtonSelect()
{
//CComponentsFooter
initVarFooter(x_pos, y_pos, w, h, buttons, parent, shadow_mode, color_frame, color_body, color_shadow);
initVarFooter(x_pos, y_pos, w, h, buttons, parent, shadow_mode, color_frame, color_body, color_shadow, sizeMode);
}
void CComponentsFooter::initVarFooter( const int& x_pos, const int& y_pos, const int& w, const int& h,
@@ -59,7 +60,8 @@ void CComponentsFooter::initVarFooter( const int& x_pos, const int& y_pos, const
int shadow_mode,
fb_pixel_t color_frame,
fb_pixel_t color_body,
fb_pixel_t color_shadow )
fb_pixel_t color_shadow,
int sizeMode)
{
cc_item_type.id = CC_ITEMTYPE_FOOTER;
cc_item_type.name = "cc_footer";
@@ -70,16 +72,17 @@ void CComponentsFooter::initVarFooter( const int& x_pos, const int& y_pos, const
//init footer width
width = width_old = w == 0 ? frameBuffer->getScreenWidth(true) : w;
//init default fonts
initDefaultFonts();
cch_font = NULL;
cch_size_mode = sizeMode;
//init font and height
initSizeMode();
if (h)
setHeight(h);
//init default button text font
ccf_btn_font = g_Font[SNeutrinoSettings::FONT_TYPE_BUTTON_TEXT];
//init footer height
initCaptionFont();
height = height_old = max(h, cch_font->getHeight());
shadow = shadow_mode;
ccf_enable_button_shadow = false ;
ccf_button_shadow_width = shadow ? OFFSET_SHADOW/2 : 0;