diff --git a/src/gui/components/cc_frm_button.cpp b/src/gui/components/cc_frm_button.cpp index f464b4800..cb3a5d4ce 100644 --- a/src/gui/components/cc_frm_button.cpp +++ b/src/gui/components/cc_frm_button.cpp @@ -117,7 +117,7 @@ void CComponentsButton::initVarButton( const int& x_pos, const int& y_pos, const append_y_offset = 0; corner_rad = RADIUS_SMALL; - cc_btn_text_col = cc_body_gradient_enable ? COL_BUTTON_TEXT_ENABLED : COL_MENUFOOT_TEXT; + cc_btn_text_col = cc_btn_text_std_col = cc_btn_text_sel_col = cc_body_gradient_enable ? COL_BUTTON_TEXT_ENABLED : COL_MENUFOOT_TEXT; cc_btn_text_disable_col = cc_body_gradient_enable ? COL_BUTTON_TEXT_DISABLED : COL_MENUCONTENTINACTIVE_TEXT; cc_btn_icon_obj = NULL; cc_btn_text_obj = NULL; @@ -224,7 +224,16 @@ void CComponentsButton::initCaption() cc_btn_text_obj->getCTextBoxObject()->setTextBorderWidth(0,0); //set color - cc_btn_text_obj->setTextColor(this->cc_item_enabled ? cc_btn_text_col : cc_btn_text_disable_col); + if (isEnabled()) + { + if(isSelected()) + cc_btn_text_col = cc_btn_text_sel_col; + else + cc_btn_text_col = cc_btn_text_std_col; + } + else + cc_btn_text_col = cc_btn_text_disable_col; + cc_btn_text_obj->setTextColor(cc_btn_text_col); //corner of text item cc_btn_text_obj->setCorner(corner_rad-w_frame, corner_type); diff --git a/src/gui/components/cc_frm_button.h b/src/gui/components/cc_frm_button.h index 5d1846a60..2c95e1830 100644 --- a/src/gui/components/cc_frm_button.h +++ b/src/gui/components/cc_frm_button.h @@ -78,9 +78,7 @@ class CComponentsButton : public CComponentsFrmChain, public CCTextScreen int cc_btn_alias; ///property: text color - fb_pixel_t cc_btn_text_col; - ///property: text color for disabled button - fb_pixel_t cc_btn_text_disable_col; + fb_pixel_t cc_btn_text_col, cc_btn_text_disable_col, cc_btn_text_std_col, cc_btn_text_sel_col; ///object: text font Font* cc_btn_font; ///object: dynamic font object handler @@ -135,7 +133,12 @@ class CComponentsButton : public CComponentsFrmChain, public CCTextScreen virtual ~CComponentsButton(){}; ///set text color - void setButtonTextColor(fb_pixel_t caption_color){cc_btn_text_col = caption_color;}; + void setButtonTextColor(const fb_pixel_t &caption_color, const fb_pixel_t &sel_caption_color = COL_BUTTON_TEXT_ENABLED, const fb_pixel_t &dis_caption_color = COL_BUTTON_TEXT_DISABLED) + { + cc_btn_text_std_col = caption_color; + cc_btn_text_sel_col = sel_caption_color; + cc_btn_text_disable_col = dis_caption_color; + }; /**Member to modify background behavior of embeded caption object. * @param[in] mode