mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-28 16:01:20 +02:00
Experimental try to rework isPainted()
This commit is contained in:
@@ -629,16 +629,32 @@ void CCDraw::paintFbItems(bool do_save_bg)
|
|||||||
fbdata.pixbuf = getScreen(fbdata.x, fbdata.y, fbdata.dx, fbdata.dy);
|
fbdata.pixbuf = getScreen(fbdata.x, fbdata.y, fbdata.dx, fbdata.dy);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
is_painted = v_fbdata[i].is_painted = true;
|
v_fbdata[i].is_painted = true;
|
||||||
OnAfterPaintBg();
|
OnAfterPaintBg();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//set is_painted attribut. if any layer was painted set it to true;
|
||||||
|
is_painted = isPainted();
|
||||||
|
|
||||||
//pick up signal if filled
|
//pick up signal if filled
|
||||||
OnAfterPaintLayers();
|
OnAfterPaintLayers();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool CCDraw::isPainted()
|
||||||
|
{
|
||||||
|
if (firstPaint)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
for(size_t i=0; i< v_fbdata.size(); i++)
|
||||||
|
if (v_fbdata[i].is_painted)
|
||||||
|
return true;
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
void CCDraw::hide()
|
void CCDraw::hide()
|
||||||
{
|
{
|
||||||
OnBeforeHide();
|
OnBeforeHide();
|
||||||
@@ -653,8 +669,8 @@ void CCDraw::hide()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
is_painted = false;
|
|
||||||
firstPaint = true;
|
firstPaint = true;
|
||||||
|
is_painted = isPainted();
|
||||||
OnAfterHide();
|
OnAfterHide();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -700,7 +716,7 @@ void CCDraw::kill(const fb_pixel_t& bg_color, const int& corner_radius, const in
|
|||||||
|
|
||||||
if (fblayer_type == CC_FBDATA_TYPES){
|
if (fblayer_type == CC_FBDATA_TYPES){
|
||||||
firstPaint = true;
|
firstPaint = true;
|
||||||
is_painted = false;
|
is_painted = isPainted();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -114,7 +114,7 @@ class CCDraw : public COSDFader, public CComponentsSignals
|
|||||||
///status: true=component was painted for 1st time
|
///status: true=component was painted for 1st time
|
||||||
bool firstPaint;
|
bool firstPaint;
|
||||||
///status: true=component was rendered
|
///status: true=component was rendered
|
||||||
bool is_painted;
|
// bool is_painted;
|
||||||
///mode: true=activate rendering of basic elements (frame, shadow and body)
|
///mode: true=activate rendering of basic elements (frame, shadow and body)
|
||||||
bool paint_bg;
|
bool paint_bg;
|
||||||
///mode: true=activate rendering of frame
|
///mode: true=activate rendering of frame
|
||||||
@@ -268,7 +268,7 @@ class CCDraw : public COSDFader, public CComponentsSignals
|
|||||||
virtual void disablePaintCache(){enablePaintCache(false);}
|
virtual void disablePaintCache(){enablePaintCache(false);}
|
||||||
|
|
||||||
///returns paint mode, true=item was painted
|
///returns paint mode, true=item was painted
|
||||||
virtual bool isPainted(){return is_painted;}
|
virtual bool isPainted();
|
||||||
///allows paint of elementary item parts (shadow, frame and body), similar as background, set it usually to false, if item used in a form, returns true, if mode has changed, also cleans screnn buffer
|
///allows paint of elementary item parts (shadow, frame and body), similar as background, set it usually to false, if item used in a form, returns true, if mode has changed, also cleans screnn buffer
|
||||||
virtual bool doPaintBg(bool do_paint);
|
virtual bool doPaintBg(bool do_paint);
|
||||||
///allows paint frame around body, default true , NOTE: ignored if frame width = 0
|
///allows paint frame around body, default true , NOTE: ignored if frame width = 0
|
||||||
|
@@ -335,7 +335,8 @@ void CComponentsForm::exchangeCCItem(CComponentsItem* item_a, CComponentsItem* i
|
|||||||
void CComponentsForm::paintForm(bool do_save_bg)
|
void CComponentsForm::paintForm(bool do_save_bg)
|
||||||
{
|
{
|
||||||
//paint body
|
//paint body
|
||||||
paintInit(do_save_bg);
|
if (!is_painted)
|
||||||
|
paintInit(do_save_bg);
|
||||||
|
|
||||||
//paint
|
//paint
|
||||||
paintCCItems();
|
paintCCItems();
|
||||||
|
@@ -362,10 +362,12 @@ void CComponentsHeader::enableClock(bool enable, const char* format, const char*
|
|||||||
{
|
{
|
||||||
cch_cl_enable = enable;
|
cch_cl_enable = enable;
|
||||||
cch_cl_format = format;
|
cch_cl_format = format;
|
||||||
|
if (cch_cl_obj && cch_cl_enable)
|
||||||
|
cch_cl_obj->clear();
|
||||||
if (sec_format_str)
|
if (sec_format_str)
|
||||||
cch_cl_sec_format = sec_format_str;
|
cch_cl_sec_format = sec_format_str;
|
||||||
cch_cl_enable_run = run;
|
cch_cl_enable_run = run;
|
||||||
if (!enable){
|
if (!cch_cl_enable){
|
||||||
if (cch_cl_obj){
|
if (cch_cl_obj){
|
||||||
cch_cl_enable_run = false;
|
cch_cl_enable_run = false;
|
||||||
removeCCItem(cch_cl_obj);
|
removeCCItem(cch_cl_obj);
|
||||||
@@ -544,7 +546,7 @@ void CComponentsHeader::paint(bool do_save_bg)
|
|||||||
initCCItems();
|
initCCItems();
|
||||||
|
|
||||||
//paint form contents
|
//paint form contents
|
||||||
paintForm(do_save_bg);
|
CComponentsForm::paint(do_save_bg);
|
||||||
|
|
||||||
//start clock if enabled
|
//start clock if enabled
|
||||||
if (cch_cl_obj){
|
if (cch_cl_obj){
|
||||||
|
@@ -107,6 +107,7 @@ bool CInfoClock::StopInfoClock()
|
|||||||
{
|
{
|
||||||
bool ret = Stop();
|
bool ret = Stop();
|
||||||
kill();
|
kill();
|
||||||
|
clear();
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@@ -252,6 +252,7 @@ void CInfoViewer::initClock()
|
|||||||
}
|
}
|
||||||
|
|
||||||
CInfoClock::getInstance()->disableInfoClock();
|
CInfoClock::getInstance()->disableInfoClock();
|
||||||
|
clock->clear();
|
||||||
clock->enableColBodyGradient(gradient_top, COL_INFOBAR_PLUS_0);
|
clock->enableColBodyGradient(gradient_top, COL_INFOBAR_PLUS_0);
|
||||||
clock->doPaintBg(!gradient_top);
|
clock->doPaintBg(!gradient_top);
|
||||||
clock->enableTboxSaveScreen(gradient_top);
|
clock->enableTboxSaveScreen(gradient_top);
|
||||||
|
Reference in New Issue
Block a user