diff --git a/src/gui/components/cc.h b/src/gui/components/cc.h index 5c70338a4..55fdf6233 100644 --- a/src/gui/components/cc.h +++ b/src/gui/components/cc.h @@ -114,6 +114,7 @@ class CComponents { protected: int x, y, height, width, corner_type, shadow_w; + int corner_rad, fr_thickness; CFrameBuffer * frameBuffer; std::vector v_fbdata; fb_pixel_t col_body, col_shadow, col_frame; @@ -151,22 +152,7 @@ class CComponents inline virtual fb_pixel_t getColorFrame(){return col_frame;}; inline virtual fb_pixel_t getColorBody(){return col_body;}; inline virtual fb_pixel_t getColorShadow(){return col_shadow;}; - - virtual void hide(); - virtual bool isPainted(){return is_painted;}; -}; - -class CComponentsItem : public CComponents -{ - protected: - int corner_rad, fr_thickness; - void hideContainer(bool no_restore = false); - void paintInit(bool do_save_bg); - void initVarItem(); - - public: - CComponentsItem(); - + /// set corner types: Possible corner types are defined in CFrameBuffer (see: driver/framebuffer.h). inline virtual void setCornerType(const int& type){corner_type = type;}; inline virtual void setCornerRadius(const int& radius){corner_rad = radius;}; @@ -176,7 +162,21 @@ class CComponentsItem : public CComponents inline virtual void setFrameThickness(const int& thickness){fr_thickness = thickness;}; inline virtual void setShadowOnOff(bool has_shadow){shadow = has_shadow;}; + + virtual void hide(); + virtual bool isPainted(){return is_painted;}; +}; +class CComponentsItem : public CComponents +{ + protected: + void hideCCItem(bool no_restore = false); + void paintInit(bool do_save_bg); + void initVarItem(); + + public: + CComponentsItem(); + virtual void paint(bool do_save_bg = CC_SAVE_SCREEN_YES) = 0; virtual void hide(bool no_restore = false); virtual void kill(); diff --git a/src/gui/components/components.cpp b/src/gui/components/components.cpp index f75bcd9e9..3d5bdef78 100644 --- a/src/gui/components/components.cpp +++ b/src/gui/components/components.cpp @@ -211,7 +211,7 @@ void CComponentsItem::paintInit(bool do_save_bg) //restore last saved screen behind form box, //Do use parameter 'no restore' to override temporarly the restore funtionality. //This could help to avoid ugly flicker efffects if it is necessary e.g. on often repaints, without changed contents. -void CComponentsItem::hideContainer(bool no_restore) +void CComponentsItem::hideCCItem(bool no_restore) { is_painted = false; @@ -227,7 +227,7 @@ void CComponentsItem::hideContainer(bool no_restore) void CComponentsItem::hide(bool no_restore) { - hideContainer(no_restore); + hideCCItem(no_restore); } @@ -400,7 +400,7 @@ void CComponentsText::hide(bool no_restore) { if (ct_textbox) ct_textbox->hide(); - hideContainer(no_restore); + hideCCItem(no_restore); } //small helper to remove excessiv linbreaks @@ -751,7 +751,7 @@ void CComponentsPIP::paint(bool do_save_bg) void CComponentsPIP::hide(bool no_restore) { - hideContainer(no_restore); + hideCCItem(no_restore); videoDecoder->Pig(-1, -1, -1, -1); } @@ -888,7 +888,7 @@ void CComponentsPicture::paint(bool do_save_bg) void CComponentsPicture::hide(bool no_restore) { - hideContainer(no_restore); + hideCCItem(no_restore); pic_painted = false; } @@ -1619,7 +1619,7 @@ void CComponentsForm::paintCCItems() void CComponentsForm::hide(bool no_restore) { //hide body - hideContainer(no_restore); + hideCCItem(no_restore); } //-------------------------------------------------------------------------------------------------------