mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-30 08:51:10 +02:00
CComponentsItemBox: Add flag 'isCalculated' for control calculateElements()
This commit is contained in:
@@ -852,9 +852,17 @@ void CComponentsItemBox::initVarItemBox()
|
||||
prevElementLeft = 0;
|
||||
prevElementRight = 0;
|
||||
onlyOneTextElement = false;
|
||||
isCalculated = false;
|
||||
v_element_data.clear();
|
||||
}
|
||||
|
||||
int CComponentsItemBox::getHeight()
|
||||
{
|
||||
if (!isCalculated)
|
||||
calculateElements();
|
||||
return height;
|
||||
}
|
||||
|
||||
void CComponentsItemBox::clearElements()
|
||||
{
|
||||
for(size_t i = 0; i < v_element_data.size(); i++) {
|
||||
@@ -874,6 +882,7 @@ void CComponentsItemBox::clearElements()
|
||||
break;
|
||||
}
|
||||
}
|
||||
isCalculated = false;
|
||||
v_element_data.clear();
|
||||
}
|
||||
|
||||
@@ -911,6 +920,7 @@ bool CComponentsItemBox::addLogoOrText(int align, const std::string& logo, const
|
||||
v_element_data.push_back(data);
|
||||
if (index != NULL)
|
||||
*index = v_element_data.size()-1;
|
||||
isCalculated = false;
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -974,6 +984,7 @@ bool CComponentsItemBox::addElement(int align, int type, const std::string& elem
|
||||
v_element_data.push_back(data);
|
||||
if (index != NULL)
|
||||
*index = v_element_data.size()-1;
|
||||
isCalculated = false;
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1199,6 +1210,7 @@ void CComponentsItemBox::calculateElements()
|
||||
}
|
||||
|
||||
calPositionOfElements();
|
||||
isCalculated = true;
|
||||
}
|
||||
|
||||
void CComponentsItemBox::paintItemBox(bool do_save_bg)
|
||||
|
Reference in New Issue
Block a user