diff --git a/src/gui/components/cc.h b/src/gui/components/cc.h index a66990056..9b7810c6a 100644 --- a/src/gui/components/cc.h +++ b/src/gui/components/cc.h @@ -70,14 +70,6 @@ typedef struct comp_screen_data_t fb_pixel_t* pixbuf; } comp_screen_data_struct_t; -typedef enum -{ - CC_BGMODE_STANDARD, - CC_BGMODE_PERMANENT, - - CC_BGMODE_TYPES -}BGMODE_TYPES; - //align types enum { @@ -132,7 +124,6 @@ class CComponents std::vector v_fbdata; fb_pixel_t col_body, col_shadow, col_frame; bool firstPaint, shadow, is_painted; - BGMODE_TYPES bgMode; void initVarBasic(); void paintFbItems(struct comp_fbdata_t * fbdata, const int items_count, bool do_save_bg = true); @@ -162,7 +153,6 @@ class CComponents inline virtual void setColorBody(fb_pixel_t color){col_body = color;}; inline virtual void setColorShadow(fb_pixel_t color){col_shadow = color;}; 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 setBgMode(BGMODE_TYPES mode) {bgMode = mode;}; virtual void hide(); virtual bool isPainted(){return is_painted;}; diff --git a/src/gui/components/components.cpp b/src/gui/components/components.cpp index 2d09df660..5c6cfca2a 100644 --- a/src/gui/components/components.cpp +++ b/src/gui/components/components.cpp @@ -78,7 +78,6 @@ void CComponents::initVarBasic() is_painted = false; frameBuffer = CFrameBuffer::getInstance(); v_fbdata.clear(); - bgMode = CC_BGMODE_STANDARD; saved_screen.pixbuf = NULL; } @@ -89,17 +88,13 @@ void CComponents::paintFbItems(struct comp_fbdata_t * fbdata, const int items_co for(int i=0; iRestoreScreen(saved_screen.x, saved_screen.y, saved_screen.dx, saved_screen.dy, saved_screen.pixbuf); - if (no_restore) { - delete[] saved_screen.pixbuf; - saved_screen.pixbuf = NULL; - firstPaint = true; - } + if (saved_screen.pixbuf) { + frameBuffer->RestoreScreen(saved_screen.x, saved_screen.y, saved_screen.dx, saved_screen.dy, saved_screen.pixbuf); + if (no_restore) { + delete[] saved_screen.pixbuf; + saved_screen.pixbuf = NULL; + firstPaint = true; } } - else { - if (no_restore) - return; - - for(size_t i =0; i< v_fbdata.size() ;i++) { - if (v_fbdata[i].pixbuf != NULL && v_fbdata[i].fbdata_type == CC_FBDATA_TYPE_BGSCREEN) - frameBuffer->RestoreScreen(v_fbdata[i].x, v_fbdata[i].y, v_fbdata[i].dx, v_fbdata[i].dy, v_fbdata[i].pixbuf); - delete[] v_fbdata[i].pixbuf; - } - v_fbdata.clear(); - firstPaint = true; - } } void CComponentsContainer::hide(bool no_restore) @@ -338,8 +319,7 @@ void CComponentsInfoBox::initVarInfobox() { //CComponents, ComponentsContainer initVarContainer(); - bgMode = CC_BGMODE_PERMANENT; - + //CComponentsInfoBox box = NULL; textbox = NULL; @@ -447,9 +427,6 @@ CComponentsShapeSquare::CComponentsShapeSquare(const int x_pos, const int y_pos, col_frame = color_frame; col_body = color_body; col_shadow = color_shadow; - bgMode = CC_BGMODE_PERMANENT; - - } //------------------------------------------------------------------------------------------------------- @@ -469,7 +446,6 @@ CComponentsShapeCircle::CComponentsShapeCircle( int x_pos, int y_pos, int diam, col_frame = color_frame; col_body = color_body; col_shadow = color_shadow; - bgMode = CC_BGMODE_PERMANENT; //CComponentsShapeCircle width = height = d = diam; @@ -647,7 +623,6 @@ CComponentsPIP::CComponentsPIP( const int x_pos, const int y_pos, const int perc col_frame = COL_BACKGROUND; col_body = COL_BACKGROUND; col_shadow = COL_MENUCONTENTDARK_PLUS_0; - bgMode = CC_BGMODE_PERMANENT; } CComponentsPIP::~CComponentsPIP() @@ -727,7 +702,6 @@ void CComponentsPicture::init( int x_pos, int y_pos, const string& picture_name, col_frame = color_frame; col_body = color_background; col_shadow = color_shadow; - bgMode = CC_BGMODE_PERMANENT; } void CComponentsPicture::setPicture(const std::string& picture_name) @@ -1236,7 +1210,6 @@ CComponentsTitleBar::CComponentsTitleBar() { //CComponentsTitleBar initVarTitleBar(); - bgMode = CC_BGMODE_PERMANENT; } void CComponentsTitleBar::initVarTitleBar() @@ -1375,7 +1348,6 @@ void CComponentsForm::initVarForm() { //CComponentsContainer initVarContainer(); - bgMode = CC_BGMODE_PERMANENT; //simple default dimensions width = 150;