mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-31 09:21:09 +02:00
CComponentsItemBox: Add flag 'isCalculated' for control calculateElements()
Origin commit data
------------------
Branch: ni/coolstream
Commit: 33b4fc4cfa
Author: Michael Liebmann <tuxcode.bbg@gmail.com>
Date: 2012-09-04 (Tue, 04 Sep 2012)
------------------
No further description and justification available within origin commit message!
------------------
This commit was generated by Migit
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