CComponentsButton: use of global button text color

Used text color was different to old button handler.


Origin commit data
------------------
Commit: 04083bc299
Author: Thilo Graf <dbt@novatux.de>
Date: 2014-10-18 (Sat, 18 Oct 2014)
This commit is contained in:
2014-10-18 00:48:23 +02:00
parent 2a12679ee6
commit c4d6eb2761
2 changed files with 6 additions and 3 deletions

View File

@@ -115,7 +115,8 @@ void CComponentsButton::initVarButton( const int& x_pos, const int& y_pos, const
append_y_offset = 0;
corner_rad = RADIUS_MID;
cc_btn_capt_col = COL_MENUCONTENT_TEXT;
cc_btn_capt_col = COL_INFOBAR_SHADOW_TEXT;
cc_btn_capt_disable_col = COL_MENUCONTENTINACTIVE_TEXT;
cc_btn_icon_obj = NULL;
cc_btn_capt_obj = NULL;
cc_btn_dy_font = CNeutrinoFonts::getInstance();
@@ -204,7 +205,7 @@ void CComponentsButton::initCaption()
cc_btn_capt_obj->forceTextPaint(); //here required;
//set color
cc_btn_capt_obj->setTextColor(this->cc_item_enabled ? COL_MENUCONTENT_TEXT : COL_MENUCONTENTINACTIVE_TEXT);
cc_btn_capt_obj->setTextColor(this->cc_item_enabled ? cc_btn_capt_col : cc_btn_capt_disable_col);
//corner of text item
cc_btn_capt_obj->setCorner(corner_rad-fr_thickness, corner_type);

View File

@@ -74,6 +74,8 @@ class CComponentsButton : public CComponentsFrmChain
///property: text color
fb_pixel_t cc_btn_capt_col;
///property: text color for disabled button
fb_pixel_t cc_btn_capt_disable_col;
///object: text font
Font* cc_btn_font;
///object: dynamic font object handler
@@ -126,7 +128,7 @@ class CComponentsButton : public CComponentsFrmChain
fb_pixel_t color_frame = COL_DARK_GRAY, fb_pixel_t color_body = COL_MENUCONTENT_PLUS_0, fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0);
///set text color
virtual void setButtonTextColor(fb_pixel_t caption_color){cc_btn_capt_col = caption_color;};
virtual void setButtonTextColor(fb_pixel_t text_color, fb_pixel_t text_color_disabled = COL_MENUCONTENTINACTIVE_TEXT){cc_btn_capt_col = text_color; cc_btn_capt_disable_col = text_color_disabled;}
///set caption: parameter as string
virtual void setCaption(const std::string& text);