Commit fe29bc61 authored by Erwan Tulou's avatar Erwan Tulou

skins2: resize only similar layouts on-the-fly

This fixes a regression brought by ff74e967

Forcefully resizing only makes sense when layouts were designed to be similar
in size in the first place. Furthermore, it cuts off a larger layout if a
smaller one is first defined when loading a skin.

Ideally, the skins2 dtd should be extended for skins developers to explicitly
express whether two layouts are tightly-coupled or not, i.e should always be
kept the same size whatever the subsequent resizing performed by the user.
parent ac394edb
......@@ -351,7 +351,13 @@ void TopWindow::setActiveLayout( GenericLayout *pLayout )
}
// The current layout becomes inactive
m_pActiveLayout->getActiveVar().set( false );
pLayout->resize( m_pActiveLayout->getWidth(), m_pActiveLayout->getHeight() );
// if both layouts have the same original size, infer a
// subsequent resize of the active layout has to be applied
// to the new layout about to become active
if( pLayout->isTightlyCoupledWith( *m_pActiveLayout ) )
pLayout->resize( m_pActiveLayout->getWidth(),
m_pActiveLayout->getHeight() );
}
pLayout->setWindow( this );
......
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