diff --git a/src/gui/components/cc.h b/src/gui/components/cc.h index e7af3d4d3..034709e80 100644 --- a/src/gui/components/cc.h +++ b/src/gui/components/cc.h @@ -126,7 +126,7 @@ class CComponents bool firstPaint, shadow, is_painted; void initVarBasic(); - void paintFbItems(struct comp_fbdata_t * fbdata, const int items_count, bool do_save_bg = true); + void paintFbItems(bool do_save_bg = true); fb_pixel_t* getScreen(int ax, int ay, int dx, int dy); comp_screen_data_t saved_screen; diff --git a/src/gui/components/components.cpp b/src/gui/components/components.cpp index d40e617e1..0322982bb 100644 --- a/src/gui/components/components.cpp +++ b/src/gui/components/components.cpp @@ -82,16 +82,16 @@ void CComponents::initVarBasic() } //paint framebuffer stuff and fill buffer -void CComponents::paintFbItems(struct comp_fbdata_t * fbdata, const int items_count, bool do_save_bg) +void CComponents::paintFbItems(bool do_save_bg) { if (firstPaint && do_save_bg) { - for(int i=0; i 0) - frameBuffer->paintBoxFrame(fbdata[i].x, fbdata[i].y, fbdata[i].dx, fbdata[i].dy, fbdata[i].frame_thickness, fbdata[i].color, fbdata[i].r); + if (fbtype == CC_FBDATA_TYPE_FRAME && v_fbdata[i].frame_thickness > 0) + frameBuffer->paintBoxFrame(v_fbdata[i].x, v_fbdata[i].y, v_fbdata[i].dx, v_fbdata[i].dy, v_fbdata[i].frame_thickness, v_fbdata[i].color, v_fbdata[i].r); else if (fbtype == CC_FBDATA_TYPE_BACKGROUND) - frameBuffer->paintBackgroundBoxRel(x, y, fbdata[i].dx, fbdata[i].dy); + frameBuffer->paintBackgroundBoxRel(x, y, v_fbdata[i].dx, v_fbdata[i].dy); else - frameBuffer->paintBoxRel(fbdata[i].x, fbdata[i].y, fbdata[i].dx, fbdata[i].dy, fbdata[i].color, fbdata[i].r, corner_type); + frameBuffer->paintBoxRel(v_fbdata[i].x, v_fbdata[i].y, v_fbdata[i].dx, v_fbdata[i].dy, v_fbdata[i].color, v_fbdata[i].r, corner_type); } } @@ -201,9 +200,10 @@ void CComponentsContainer::paintInit(bool do_save_bg) {CC_FBDATA_TYPE_BOX, x+th, y+th, width-2*th, height-2*th, col_body, corner_rad-th, 0, NULL, NULL}, }; - int items_cnt = sizeof(fbdata) / sizeof(fbdata[0]); + for(size_t i =0; i< (sizeof(fbdata) / sizeof(fbdata[0])) ;i++) + v_fbdata.push_back(fbdata[i]); - paintFbItems(fbdata, items_cnt, do_save_bg); + paintFbItems(do_save_bg); } void CComponentsContainer::paint(bool do_save_bg) @@ -535,8 +535,6 @@ CComponentsDetailLine::~CComponentsDetailLine() //paint details line with current parameters void CComponentsDetailLine::paint(bool do_save_bg) { - int items_cnt = 0; - clear(); int y_mark_top = y-h_mark_top/2+thickness/2; @@ -569,9 +567,10 @@ void CComponentsDetailLine::paint(bool do_save_bg) {CC_FBDATA_TYPE_LINE, x+width-thickness-sw, y_mark_down+h_mark_down,thickness+sw, sw, col_shadow, 0, 0, NULL, NULL}, }; - items_cnt = sizeof(fbdata) / sizeof(fbdata[0]); + for(size_t i =0; i< (sizeof(fbdata) / sizeof(fbdata[0])) ;i++) + v_fbdata.push_back(fbdata[i]); - paintFbItems(fbdata, items_cnt, do_save_bg); + paintFbItems(do_save_bg); } //remove painted fb items from screen