Commit 5cbb5d86 authored by Erwan Tulou's avatar Erwan Tulou

skins2: remove unnecessary notifyLayout()

In today's implementation, notifyLayout() for a control leads to a whole
 layout rebuilt. Therefore, this function must be called _only_ if needed.

- Never needed in onResize() since we are already in the process of rebuilding
the whole layout. Calling notifyLayout() means the job is done twice.
- Never needed in onPositionChange() for the same reason as onResize().
- Not needed for a checkbox since already called in setImage() two lines above.
parent e0674167
......@@ -276,7 +276,5 @@ void CtrlCheckbox::changeButton()
// Notify the window the tooltip has changed
notifyTooltipChange();
// Refresh
notifyLayout();
}
......@@ -78,9 +78,8 @@ void CtrlList::onUpdate( Subject<VarPercent> &rPercent, void *arg )
// Get the size of the control
const Position *pPos = getPosition();
if( !pPos )
{
return;
}
int height = pPos->getHeight();
// How many lines can be displayed ?
......@@ -114,9 +113,8 @@ void CtrlList::onResize()
// Get the size of the control
const Position *pPos = getPosition();
if( !pPos )
{
return;
}
int height = pPos->getHeight();
// How many lines can be displayed ?
......@@ -142,14 +140,12 @@ void CtrlList::onResize()
}
makeImage();
notifyLayout();
}
void CtrlList::onPositionChange()
{
makeImage();
notifyLayout();
}
......
......@@ -244,13 +244,11 @@ void CtrlTree::onResize()
// Redraw the control if the position has changed
m_firstPos = it;
makeImage();
notifyLayout();
}
void CtrlTree::onPositionChange()
{
makeImage();
notifyLayout();
}
void CtrlTree::handleEvent( EvtGeneric &rEvent )
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment