Commit 13db37f5 authored by Erwan Tulou's avatar Erwan Tulou

skins2: avoid layout resize if size is unchanged

parent 44febce3
...@@ -174,6 +174,10 @@ void GenericLayout::onControlUpdate( const CtrlGeneric &rCtrl, ...@@ -174,6 +174,10 @@ void GenericLayout::onControlUpdate( const CtrlGeneric &rCtrl,
void GenericLayout::resize( int width, int height ) void GenericLayout::resize( int width, int height )
{ {
// check real resize
if( width == m_rect.getWidth() && height == m_rect.getHeight() )
return;
// Update the window size // Update the window size
m_rect = SkinsRect( 0, 0 , width, height ); m_rect = SkinsRect( 0, 0 , width, height );
...@@ -191,16 +195,6 @@ void GenericLayout::resize( int width, int height ) ...@@ -191,16 +195,6 @@ void GenericLayout::resize( int width, int height )
{ {
iter->m_pControl->onResize(); iter->m_pControl->onResize();
} }
// Resize and refresh the associated window
TopWindow *pWindow = getWindow();
if( pWindow )
{
// Resize the window
pWindow->resize( width, height );
// Change the shape of the window and redraw it
refreshAll();
}
} }
...@@ -236,7 +230,6 @@ void GenericLayout::refreshRect( int x, int y, int width, int height ) ...@@ -236,7 +230,6 @@ void GenericLayout::refreshRect( int x, int y, int width, int height )
{ {
// first apply new shape to the window // first apply new shape to the window
pWindow->updateShape(); pWindow->updateShape();
pWindow->invalidateRect( x, y, width, height ); pWindow->invalidateRect( x, y, width, height );
} }
} }
......
...@@ -278,6 +278,13 @@ void WindowManager::resize( GenericLayout &rLayout, ...@@ -278,6 +278,13 @@ void WindowManager::resize( GenericLayout &rLayout,
// Do the actual resizing // Do the actual resizing
rLayout.resize( newWidth, newHeight ); rLayout.resize( newWidth, newHeight );
// Resize the window
TopWindow *pWindow = rLayout.getWindow();
pWindow->resize( newWidth, newHeight );
// refresh content
rLayout.refreshAll();
// Move all the anchored windows // Move all the anchored windows
WinSet_t::const_iterator it; WinSet_t::const_iterator it;
if( m_direction == kResizeE || if( m_direction == kResizeE ||
......
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