diff --git a/src/gui/components/cc_base.cpp b/src/gui/components/cc_base.cpp index 603e272a1..95df476cb 100644 --- a/src/gui/components/cc_base.cpp +++ b/src/gui/components/cc_base.cpp @@ -64,6 +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; } CComponents::~CComponents() @@ -200,7 +202,7 @@ void CComponents::paintFbItems(bool do_save_bg) } else { if(cc_allow_paint) { - if ((v_fbdata[i].fbdata_type == CC_FBDATA_TYPE_BOX) && (v_fbdata[i].data != NULL)) { + if (paintGradient && (v_fbdata[i].fbdata_type == CC_FBDATA_TYPE_BOX) && (v_fbdata[i].data != NULL)) { // color gradient gradientData_t *gradientData = static_cast (v_fbdata[i].data); if (gradientData->boxBuf == NULL) @@ -314,3 +316,9 @@ void CComponents::setFrameThickness(const int& thickness, const int& thickness_s if (fr_thickness_sel != thickness_sel) fr_thickness_sel = thickness_sel; } + + +void CComponents::setPaintGradient(bool do_paint_gradient) +{ + paintGradient = g_settings.gradiant ? do_paint_gradient : false; +} diff --git a/src/gui/components/cc_base.h b/src/gui/components/cc_base.h index 5ce448cb7..e20330fd9 100644 --- a/src/gui/components/cc_base.h +++ b/src/gui/components/cc_base.h @@ -78,6 +78,13 @@ class CComponents : public CComponentsSignals, public COSDFader ///property: color of frame if component is selected, Note: fr_thickness_sel must be set fb_pixel_t col_frame_sel; + ///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; + ///property: true=component has shadow bool shadow; ///property: width of shadow @@ -179,6 +186,8 @@ class CComponents : public CComponentsSignals, public COSDFader ///set all basic framebuffer element colors at once ///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); ///get frame color inline virtual fb_pixel_t getColorFrame(){return col_frame;}; @@ -186,7 +195,7 @@ class CComponents : public CComponentsSignals, public COSDFader inline virtual fb_pixel_t getColorBody(){return col_body;}; ///get shadow color inline virtual fb_pixel_t getColorShadow(){return col_shadow;}; - + ///set corner types ///Possible corner types are defined in CFrameBuffer (see: driver/framebuffer.h) ///Note: default values are given from settings @@ -249,8 +258,6 @@ class CComponentsItem : public CComponents ///Is typically the type CComponentsForm or derived classes, default intialized with NULL CComponentsForm *cc_parent; - gradientData_t cc_gradientData; - ///hides item, arg: no_restore=true causes no restore of background, but clean up pixel buffer if required void hideCCItem(bool no_restore = false); diff --git a/src/gui/components/cc_frm_footer.cpp b/src/gui/components/cc_frm_footer.cpp index 8769b1013..1db98fec7 100644 --- a/src/gui/components/cc_frm_footer.cpp +++ b/src/gui/components/cc_frm_footer.cpp @@ -76,6 +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; corner_rad = RADIUS_LARGE; corner_type = CORNER_BOTTOM; diff --git a/src/gui/components/cc_frm_header.cpp b/src/gui/components/cc_frm_header.cpp index 570d91f07..45173a4bc 100644 --- a/src/gui/components/cc_frm_header.cpp +++ b/src/gui/components/cc_frm_header.cpp @@ -115,9 +115,7 @@ 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; - - gradientBuf = NULL; - paintGradient = false; + paintGradient = g_settings.gradiant; addContextButton(buttons); initCCItems(); diff --git a/src/gui/components/cc_frm_header.h b/src/gui/components/cc_frm_header.h index ad080081c..33b66b31e 100644 --- a/src/gui/components/cc_frm_header.h +++ b/src/gui/components/cc_frm_header.h @@ -49,9 +49,6 @@ class CComponentsHeader : public CComponentsForm fb_pixel_t color_body = COL_MENUHEAD_PLUS_0, fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0); - fb_pixel_t *gradientBuf; - bool paintGradient; - protected: ///object: icon object, see also setIcon() CComponentsPicture * cch_icon_obj; @@ -203,9 +200,6 @@ class CComponentsHeader : public CComponentsForm ///paint header virtual void paint(bool do_save_bg = CC_SAVE_SCREEN_YES); - - //set color gradient an/off - virtual void setPaintGradient(bool g) { paintGradient = g; }; }; //! Sub class of CComponentsHeader. diff --git a/src/gui/components/cc_frm_window.cpp b/src/gui/components/cc_frm_window.cpp index 73c499550..07f2b67a5 100644 --- a/src/gui/components/cc_frm_window.cpp +++ b/src/gui/components/cc_frm_window.cpp @@ -200,7 +200,6 @@ void CComponentsWindow::initHeader() ccw_head->setCaption(ccw_caption, ccw_align_mode); ccw_head->setContextButton(ccw_buttons); ccw_head->setCorner(corner_rad, CORNER_TOP); - ccw_head->setPaintGradient(g_settings.gradiant); } } diff --git a/src/gui/widget/menue.cpp b/src/gui/widget/menue.cpp index 5222da929..48b9db0f0 100644 --- a/src/gui/widget/menue.cpp +++ b/src/gui/widget/menue.cpp @@ -1099,7 +1099,6 @@ void CMenuWidget::paint() // paint head CComponentsHeader header(x, y, width + sb_width, hheight, getName(), iconfile); - header.setPaintGradient(g_settings.gradiant); header.setShadowOnOff(CC_SHADOW_ON); header.setOffset(10); header.paint(CC_SAVE_SCREEN_NO);