mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-28 07:51:19 +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);
|
||||
}
|
||||
}
|
||||
is_painted = v_fbdata[i].is_painted = true;
|
||||
v_fbdata[i].is_painted = true;
|
||||
OnAfterPaintBg();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//set is_painted attribut. if any layer was painted set it to true;
|
||||
is_painted = isPainted();
|
||||
|
||||
//pick up signal if filled
|
||||
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()
|
||||
{
|
||||
OnBeforeHide();
|
||||
@@ -653,8 +669,8 @@ void CCDraw::hide()
|
||||
}
|
||||
}
|
||||
}
|
||||
is_painted = false;
|
||||
firstPaint = true;
|
||||
is_painted = isPainted();
|
||||
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){
|
||||
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
|
||||
bool firstPaint;
|
||||
///status: true=component was rendered
|
||||
bool is_painted;
|
||||
// bool is_painted;
|
||||
///mode: true=activate rendering of basic elements (frame, shadow and body)
|
||||
bool paint_bg;
|
||||
///mode: true=activate rendering of frame
|
||||
@@ -268,7 +268,7 @@ class CCDraw : public COSDFader, public CComponentsSignals
|
||||
virtual void disablePaintCache(){enablePaintCache(false);}
|
||||
|
||||
///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
|
||||
virtual bool doPaintBg(bool do_paint);
|
||||
///allows paint frame around body, default true , NOTE: ignored if frame width = 0
|
||||
|
@@ -335,6 +335,7 @@ void CComponentsForm::exchangeCCItem(CComponentsItem* item_a, CComponentsItem* i
|
||||
void CComponentsForm::paintForm(bool do_save_bg)
|
||||
{
|
||||
//paint body
|
||||
if (!is_painted)
|
||||
paintInit(do_save_bg);
|
||||
|
||||
//paint
|
||||
|
@@ -362,10 +362,12 @@ void CComponentsHeader::enableClock(bool enable, const char* format, const char*
|
||||
{
|
||||
cch_cl_enable = enable;
|
||||
cch_cl_format = format;
|
||||
if (cch_cl_obj && cch_cl_enable)
|
||||
cch_cl_obj->clear();
|
||||
if (sec_format_str)
|
||||
cch_cl_sec_format = sec_format_str;
|
||||
cch_cl_enable_run = run;
|
||||
if (!enable){
|
||||
if (!cch_cl_enable){
|
||||
if (cch_cl_obj){
|
||||
cch_cl_enable_run = false;
|
||||
removeCCItem(cch_cl_obj);
|
||||
@@ -544,7 +546,7 @@ void CComponentsHeader::paint(bool do_save_bg)
|
||||
initCCItems();
|
||||
|
||||
//paint form contents
|
||||
paintForm(do_save_bg);
|
||||
CComponentsForm::paint(do_save_bg);
|
||||
|
||||
//start clock if enabled
|
||||
if (cch_cl_obj){
|
||||
|
@@ -107,6 +107,7 @@ bool CInfoClock::StopInfoClock()
|
||||
{
|
||||
bool ret = Stop();
|
||||
kill();
|
||||
clear();
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
@@ -252,6 +252,7 @@ void CInfoViewer::initClock()
|
||||
}
|
||||
|
||||
CInfoClock::getInstance()->disableInfoClock();
|
||||
clock->clear();
|
||||
clock->enableColBodyGradient(gradient_top, COL_INFOBAR_PLUS_0);
|
||||
clock->doPaintBg(!gradient_top);
|
||||
clock->enableTboxSaveScreen(gradient_top);
|
||||
|
Reference in New Issue
Block a user