Commit 34095bee authored by Hugo Pereira Da Costa's avatar Hugo Pereira Da Costa
Browse files

Fixed handling of minimum widget size when toggling expert button

CCBUG: 314764
parent 962f6c63
......@@ -227,6 +227,8 @@ namespace Oxygen
_generalExpertWidget->setVisible( _expertMode );
_viewsExpertWidget->setVisible( _expertMode );
updateMinimumSize();
}
//__________________________________________________________________
......@@ -235,6 +237,7 @@ namespace Oxygen
switch( event->type() )
{
case QEvent::ShowToParent:
object->event( event );
updateLayout();
......@@ -246,15 +249,37 @@ namespace Oxygen
}
//__________________________________________________________________
void StyleConfig::updateLayout( void )
bool StyleConfig::event( QEvent* event )
{
const bool result( QWidget::event( event ) );
switch( event->type() )
{
case QEvent::Show:
case QEvent::ShowToParent:
updateMinimumSize();
break;
default: break;
}
if( !_animationConfigWidget ) return;
int delta = _animationConfigWidget->minimumSizeHint().height() - _animationConfigWidget->size().height();
window()->setMinimumSize( QSize( window()->minimumSizeHint().width(), window()->size().height() + delta ) );
return result;
}
//__________________________________________________________________
void StyleConfig::updateMinimumSize( void )
{ setMinimumSize( minimumSizeHint() ); }
//__________________________________________________________________
void StyleConfig::updateLayout( void )
{
if( _animationConfigWidget )
{
const int delta = _animationConfigWidget->minimumSizeHint().height() - _animationConfigWidget->size().height();
window()->setMinimumSize( QSize( window()->minimumSizeHint().width(), window()->size().height() + delta ) );
}
}
//__________________________________________________________________
void StyleConfig::updateChanged()
{
......
......@@ -75,6 +75,9 @@ namespace Oxygen
protected Q_SLOTS:
//! update minimum size
void updateMinimumSize( void );
//! update layout
/*! needed in expert mode to accommodate with animations config widget size changes */
void updateLayout( void );
......@@ -97,6 +100,9 @@ namespace Oxygen
protected:
//! event processing
virtual bool event( QEvent* );
//! load setup from config data
void load( void );
......
Supports Markdown
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