From 41c01cedad66ea665cc72a32344a82868f05fb8e Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Wed, 30 Apr 2014 11:12:57 +0200 Subject: [PATCH] CComponentsFooter: add possibility to change font type --- src/gui/components/cc_frm_footer.cpp | 4 +++- src/gui/components/cc_frm_footer.h | 6 ++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/gui/components/cc_frm_footer.cpp b/src/gui/components/cc_frm_footer.cpp index 9bde8c8d3..fe8e10321 100644 --- a/src/gui/components/cc_frm_footer.cpp +++ b/src/gui/components/cc_frm_footer.cpp @@ -82,6 +82,7 @@ void CComponentsFooter::initVarFooter( const int& x_pos, const int& y_pos, const corner_type = CORNER_BOTTOM; btn_contour = false; + ccf_btn_font = NULL; addContextButton(buttons); initCCItems(); @@ -121,9 +122,10 @@ void CComponentsFooter::setButtonLabels(const struct button_label_s * const cont int w_btn_offset = w_btn_unused / (label_count+1); btnchain->setAppendOffset(w_btn_offset, 0); - //finally generate button objects passed from button label content. + //finally generate and add button objects passed from button label content. for (size_t i= 0; i< label_count; i++){ CComponentsButton *btn = new CComponentsButton(CC_APPEND, CC_CENTERED, w_btn, height-height/4, content[i].text, content[i].button); + btn->setButtonFont(ccf_btn_font); btn->doPaintBg(btn_contour); btnchain->addCCItem(btn); } diff --git a/src/gui/components/cc_frm_footer.h b/src/gui/components/cc_frm_footer.h index db478637c..2d6ed3fe4 100644 --- a/src/gui/components/cc_frm_footer.h +++ b/src/gui/components/cc_frm_footer.h @@ -60,6 +60,9 @@ class CComponentsFooter : public CComponentsHeader ///show button frame and background, default false bool btn_contour; + ///property: set font for label caption, see also setButtonFont() + Font* ccf_btn_font; + public: CComponentsFooter(CComponentsForm *parent = NULL); @@ -87,6 +90,9 @@ class CComponentsFooter : public CComponentsHeader ///causes show/hide countour of button frame and background, parameter bool show, default= true void showButtonContour(bool show = true){btn_contour = show;}; + + ///property: set font for label caption, parameter as font object, value NULL causes usage of dynamic font + void setButtonFont(Font* font){ccf_btn_font = font;}; }; #endif