mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-28 07:51:19 +02:00
CComponents/CComponentsItem: add advanced version of kill()
kill() allows now paint with defined colors over rendered objects without restore of background. It's similar to paintBackgroundBoxRel() known from CFrameBuffer, but with possiblity to define color, default color is 0 like before (empty background). Items with parent bindings use the background color of its parent as default, but can also be ignored. This function can be useful before repaint of items and/or, if required, to have a clean background inside item containers.
This commit is contained in:
@@ -133,6 +133,22 @@ void CComponentsItem::hide(bool no_restore)
|
||||
hideCCItem(no_restore);
|
||||
}
|
||||
|
||||
//erase or paint over rendered objects
|
||||
void CComponentsItem::kill(const fb_pixel_t& bg_color, bool ignore_parent)
|
||||
{
|
||||
if(bg_color || cc_parent == NULL){
|
||||
CComponents::kill(bg_color);
|
||||
return;
|
||||
}
|
||||
|
||||
if (cc_parent){
|
||||
if(bg_color || ignore_parent)
|
||||
CComponents::kill(bg_color);
|
||||
else
|
||||
CComponents::kill(cc_parent->getColorBody());
|
||||
}
|
||||
}
|
||||
|
||||
//synchronize colors for forms
|
||||
//This is usefull if the system colors are changed during runtime
|
||||
//so you can ensure correct applied system colors in relevant objects with unchanged instances.
|
||||
|
Reference in New Issue
Block a user