From 9c47a80d3d5300ca892871c3741ed51887c2990f Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 20 Nov 2016 01:33:34 +0100 Subject: [PATCH] CComponentsFooter: add parameter for frame width for selected buttons Frame width was hard coded. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/696989dcf1740b606258617195388ee1f22c95da Author: Thilo Graf Date: 2016-11-20 (Sun, 20 Nov 2016) ------------------ This commit was generated by Migit --- src/gui/components/cc_frm_footer.cpp | 9 +++++++-- src/gui/components/cc_frm_footer.h | 8 +++++++- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/src/gui/components/cc_frm_footer.cpp b/src/gui/components/cc_frm_footer.cpp index 8256752cd..4a1cbfc4e 100644 --- a/src/gui/components/cc_frm_footer.cpp +++ b/src/gui/components/cc_frm_footer.cpp @@ -345,7 +345,12 @@ void CComponentsFooter::enableButtonBg(bool enable) } } -void CComponentsFooter::setSelectedButton(size_t item_id, const fb_pixel_t& fr_col, const fb_pixel_t& sel_fr_col, const fb_pixel_t& bg_col, const fb_pixel_t& sel_bg_col, const fb_pixel_t& text_col, const fb_pixel_t& sel_text_col) +void CComponentsFooter::setSelectedButton(size_t item_id, + const fb_pixel_t& fr_col, const fb_pixel_t& sel_fr_col, + const fb_pixel_t& bg_col, const fb_pixel_t& sel_bg_col, + const fb_pixel_t& text_col, const fb_pixel_t& sel_text_col, + const int& frame_width, + const int& sel_frame_width) { if (chain){ for (size_t i= 0; i< chain->size(); i++){ @@ -355,7 +360,7 @@ void CComponentsFooter::setSelectedButton(size_t item_id, const fb_pixel_t& fr_c fb_pixel_t sel_col = fr_col; if (chain->size() > 1) sel_col = sel_fr_col; //TODO: make it configurable - chain->setSelectedItem(item_id, sel_col, fr_col, sel_bg_col, bg_col, 1, 2); + chain->setSelectedItem(item_id, sel_col, fr_col, sel_bg_col, bg_col, frame_width, sel_frame_width); if (chain->size() > 1) getSelectedButtonObject()->setButtonTextColor(sel_text_col); diff --git a/src/gui/components/cc_frm_footer.h b/src/gui/components/cc_frm_footer.h index 7796aac39..49bd3fae6 100644 --- a/src/gui/components/cc_frm_footer.h +++ b/src/gui/components/cc_frm_footer.h @@ -152,6 +152,10 @@ class CComponentsFooter : public CComponentsHeader * @li optional: exepts type fb_pixel_t, as default text color * @param[in] sel_text_col * @li optional: exepts type fb_pixel_t, as selected text color + * @param[in] frame_width + * @li optional: exepts type int, default = 1 + * @param[in] sel_frame_width + * @li optional: exepts type int, default = 2 */ void setSelectedButton(size_t item_id, const fb_pixel_t& fr_col = COL_MENUCONTENTSELECTED_PLUS_2, @@ -159,7 +163,9 @@ class CComponentsFooter : public CComponentsHeader const fb_pixel_t& bg_col = COL_MENUFOOT_PLUS_0, /*TODO disabled at the moment, without effect*/ const fb_pixel_t& sel_bg_col = COL_MENUCONTENTSELECTED_PLUS_2, /*TODO disabled at the moment, without effect*/ const fb_pixel_t& text_col = COL_MENUCONTENTDARK_TEXT_PLUS_2, - const fb_pixel_t& sel_text_col = COL_MENUCONTENT_TEXT); + const fb_pixel_t& sel_text_col = COL_MENUCONTENT_TEXT, + const int& frame_width = 1, + const int& sel_frame_width = 2); ///returns id of select button, return value as int, -1 = nothing is selected int getSelectedButton(); ///returns selected button object, return value as pointer to object, NULL means nothing is selected