CComponents: rename gradient variables

Use convention for cc classes.
paintGradient probaly too general and
is related to body, other fb types can be also handled with gradient.
This commit is contained in:
2014-09-20 21:34:49 +02:00
committed by [CST] Focus
parent 64c84fb490
commit 83070da483
4 changed files with 17 additions and 17 deletions

View File

@@ -64,8 +64,8 @@ CComponents::CComponents() : COSDFader(g_settings.theme.menu_Content_alpha)
frameBuffer = CFrameBuffer::getInstance(); frameBuffer = CFrameBuffer::getInstance();
v_fbdata.clear(); v_fbdata.clear();
saved_screen.pixbuf = NULL; saved_screen.pixbuf = NULL;
gradientBuf = NULL; cc_gradientBuf = NULL;
paintGradient = false; col_body_gradient = false;
} }
CComponents::~CComponents() CComponents::~CComponents()
@@ -202,7 +202,7 @@ void CComponents::paintFbItems(bool do_save_bg)
} }
else { else {
if(cc_allow_paint) { if(cc_allow_paint) {
if (paintGradient && (v_fbdata[i].fbdata_type == CC_FBDATA_TYPE_BOX) && (v_fbdata[i].data != NULL)) { if (col_body_gradient && (v_fbdata[i].fbdata_type == CC_FBDATA_TYPE_BOX) && (v_fbdata[i].data != NULL)) {
// color gradient // color gradient
gradientData_t *gradientData = static_cast<gradientData_t*> (v_fbdata[i].data); gradientData_t *gradientData = static_cast<gradientData_t*> (v_fbdata[i].data);
if (gradientData->boxBuf == NULL) if (gradientData->boxBuf == NULL)
@@ -318,7 +318,7 @@ void CComponents::setFrameThickness(const int& thickness, const int& thickness_s
} }
void CComponents::setPaintGradient(bool do_paint_gradient) void CComponents::enableColBodyGradient(bool do_paint_gradient)
{ {
paintGradient = g_settings.gradiant ? do_paint_gradient : false; col_body_gradient = g_settings.gradiant ? do_paint_gradient : false;
} }

View File

@@ -81,9 +81,9 @@ class CComponents : public CComponentsSignals, public COSDFader
///property: contains data for gradiant handling ///property: contains data for gradiant handling
gradientData_t cc_gradientData; gradientData_t cc_gradientData;
///gradiant pixel buffer ///gradiant pixel buffer
fb_pixel_t *gradientBuf; fb_pixel_t *cc_gradientBuf;
///property: true component can paint gradient, see also setPaintGradient() ///property: true component can paint gradient, see also enableColBodyGradient()
bool paintGradient; bool col_body_gradient;
///property: true=component has shadow ///property: true=component has shadow
bool shadow; bool shadow;
@@ -187,7 +187,7 @@ class CComponents : public CComponentsSignals, public COSDFader
///Note: Possible color values are defined in "gui/color.h" and "gui/customcolor.h" ///Note: Possible color values are defined in "gui/color.h" and "gui/customcolor.h"
inline virtual void setColorAll(fb_pixel_t color_frame, fb_pixel_t color_body, fb_pixel_t color_shadow){col_frame = color_frame; col_body = color_body; col_shadow = color_shadow;}; inline virtual void setColorAll(fb_pixel_t color_frame, fb_pixel_t color_body, fb_pixel_t color_shadow){col_frame = color_frame; col_body = color_body; col_shadow = color_shadow;};
///set color gradient on/off ///set color gradient on/off
virtual void setPaintGradient(bool do_paint_gradient); virtual void enableColBodyGradient(bool do_paint_gradient);
///get frame color ///get frame color
inline virtual fb_pixel_t getColorFrame(){return col_frame;}; inline virtual fb_pixel_t getColorFrame(){return col_frame;};

View File

@@ -76,7 +76,7 @@ void CComponentsFooter::initVarFooter( const int& x_pos, const int& y_pos, const
col_frame = color_frame; col_frame = color_frame;
col_body = color_body; col_body = color_body;
col_shadow = color_shadow; col_shadow = color_shadow;
paintGradient = false; col_body_gradient = false;
corner_rad = RADIUS_LARGE; corner_rad = RADIUS_LARGE;
corner_type = CORNER_BOTTOM; corner_type = CORNER_BOTTOM;

View File

@@ -98,6 +98,7 @@ void CComponentsHeader::initVarHeader( const int& x_pos, const int& y_pos, const
col_body = color_body; col_body = color_body;
col_shadow = color_shadow; col_shadow = color_shadow;
col_body = COL_MENUHEAD_PLUS_0; col_body = COL_MENUHEAD_PLUS_0;
col_body_gradient = g_settings.gradiant;
cch_text = caption; cch_text = caption;
cch_icon_name = icon_name; cch_icon_name = icon_name;
@@ -115,7 +116,6 @@ void CComponentsHeader::initVarHeader( const int& x_pos, const int& y_pos, const
cch_icon_w = 0; cch_icon_w = 0;
cch_text_x = cch_offset; cch_text_x = cch_offset;
cch_buttons_space = cch_offset; cch_buttons_space = cch_offset;
paintGradient = g_settings.gradiant;
addContextButton(buttons); addContextButton(buttons);
initCCItems(); initCCItems();
@@ -126,8 +126,8 @@ CComponentsHeader::~CComponentsHeader()
{ {
dprintf(DEBUG_DEBUG, "[~CComponentsHeader] [%s - %d] delete...\n", __func__, __LINE__); dprintf(DEBUG_DEBUG, "[~CComponentsHeader] [%s - %d] delete...\n", __func__, __LINE__);
v_cch_btn.clear(); v_cch_btn.clear();
if (gradientBuf) if (cc_gradientBuf)
free(gradientBuf); free(cc_gradientBuf);
} }
void CComponentsHeader::setCaption(const std::string& caption, const int& align_mode) void CComponentsHeader::setCaption(const std::string& caption, const int& align_mode)
@@ -391,11 +391,11 @@ void CComponentsHeader::initCaption()
void CComponentsHeader::initGradient() void CComponentsHeader::initGradient()
{ {
if (gradientBuf == NULL) { if (cc_gradientBuf == NULL) {
CColorGradient ccGradient; CColorGradient ccGradient;
gradientBuf = ccGradient.gradientOneColor(col_body, NULL, height, CColorGradient::gradientLight2Dark, CColorGradient::light); cc_gradientBuf = ccGradient.gradientOneColor(col_body, NULL, height, CColorGradient::gradientLight2Dark, CColorGradient::light);
} }
cc_gradientData.gradientBuf = gradientBuf; cc_gradientData.gradientBuf = cc_gradientBuf;
cc_gradientData.direction = CFrameBuffer::gradientVertical; cc_gradientData.direction = CFrameBuffer::gradientVertical;
cc_gradientData.mode = CFrameBuffer::pbrg_noOption; cc_gradientData.mode = CFrameBuffer::pbrg_noOption;
@@ -419,7 +419,7 @@ void CComponentsHeader::initCCItems()
initCaption(); initCaption();
//init color gradient //init color gradient
if (paintGradient) if (col_body_gradient)
initGradient(); initGradient();
} }