mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-28 16:01:20 +02:00
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:
@@ -64,8 +64,8 @@ CComponents::CComponents() : COSDFader(g_settings.theme.menu_Content_alpha)
|
||||
frameBuffer = CFrameBuffer::getInstance();
|
||||
v_fbdata.clear();
|
||||
saved_screen.pixbuf = NULL;
|
||||
gradientBuf = NULL;
|
||||
paintGradient = false;
|
||||
cc_gradientBuf = NULL;
|
||||
col_body_gradient = false;
|
||||
}
|
||||
|
||||
CComponents::~CComponents()
|
||||
@@ -202,7 +202,7 @@ void CComponents::paintFbItems(bool do_save_bg)
|
||||
}
|
||||
else {
|
||||
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
|
||||
gradientData_t *gradientData = static_cast<gradientData_t*> (v_fbdata[i].data);
|
||||
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;
|
||||
}
|
||||
|
@@ -81,9 +81,9 @@ class CComponents : public CComponentsSignals, public COSDFader
|
||||
///property: contains data for gradiant handling
|
||||
gradientData_t cc_gradientData;
|
||||
///gradiant pixel buffer
|
||||
fb_pixel_t *gradientBuf;
|
||||
///property: true component can paint gradient, see also setPaintGradient()
|
||||
bool paintGradient;
|
||||
fb_pixel_t *cc_gradientBuf;
|
||||
///property: true component can paint gradient, see also enableColBodyGradient()
|
||||
bool col_body_gradient;
|
||||
|
||||
///property: true=component has 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"
|
||||
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
|
||||
virtual void setPaintGradient(bool do_paint_gradient);
|
||||
virtual void enableColBodyGradient(bool do_paint_gradient);
|
||||
|
||||
///get frame color
|
||||
inline virtual fb_pixel_t getColorFrame(){return col_frame;};
|
||||
|
@@ -76,7 +76,7 @@ void CComponentsFooter::initVarFooter( const int& x_pos, const int& y_pos, const
|
||||
col_frame = color_frame;
|
||||
col_body = color_body;
|
||||
col_shadow = color_shadow;
|
||||
paintGradient = false;
|
||||
col_body_gradient = false;
|
||||
|
||||
corner_rad = RADIUS_LARGE;
|
||||
corner_type = CORNER_BOTTOM;
|
||||
|
@@ -98,6 +98,7 @@ void CComponentsHeader::initVarHeader( const int& x_pos, const int& y_pos, const
|
||||
col_body = color_body;
|
||||
col_shadow = color_shadow;
|
||||
col_body = COL_MENUHEAD_PLUS_0;
|
||||
col_body_gradient = g_settings.gradiant;
|
||||
cch_text = caption;
|
||||
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_text_x = cch_offset;
|
||||
cch_buttons_space = cch_offset;
|
||||
paintGradient = g_settings.gradiant;
|
||||
|
||||
addContextButton(buttons);
|
||||
initCCItems();
|
||||
@@ -126,8 +126,8 @@ CComponentsHeader::~CComponentsHeader()
|
||||
{
|
||||
dprintf(DEBUG_DEBUG, "[~CComponentsHeader] [%s - %d] delete...\n", __func__, __LINE__);
|
||||
v_cch_btn.clear();
|
||||
if (gradientBuf)
|
||||
free(gradientBuf);
|
||||
if (cc_gradientBuf)
|
||||
free(cc_gradientBuf);
|
||||
}
|
||||
|
||||
void CComponentsHeader::setCaption(const std::string& caption, const int& align_mode)
|
||||
@@ -391,11 +391,11 @@ void CComponentsHeader::initCaption()
|
||||
|
||||
void CComponentsHeader::initGradient()
|
||||
{
|
||||
if (gradientBuf == NULL) {
|
||||
if (cc_gradientBuf == NULL) {
|
||||
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.mode = CFrameBuffer::pbrg_noOption;
|
||||
|
||||
@@ -419,7 +419,7 @@ void CComponentsHeader::initCCItems()
|
||||
initCaption();
|
||||
|
||||
//init color gradient
|
||||
if (paintGradient)
|
||||
if (col_body_gradient)
|
||||
initGradient();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user