diff --git a/kontact/src/iconsidepane.h b/kontact/src/iconsidepane.h --- a/kontact/src/iconsidepane.h +++ b/kontact/src/iconsidepane.h @@ -109,9 +109,6 @@ public slots: virtual void updatePlugins(); - protected: - void resizeEvent( QResizeEvent *event ); - private: Navigator *mNavigator; }; diff --git a/kontact/src/iconsidepane.cpp b/kontact/src/iconsidepane.cpp --- a/kontact/src/iconsidepane.cpp +++ b/kontact/src/iconsidepane.cpp @@ -343,6 +343,8 @@ connect( selectionModel(), SIGNAL(currentChanged(QModelIndex,QModelIndex)), this, SLOT(slotCurrentChanged(QModelIndex)) ); + + QTimer::singleShot( 0, this, SLOT(updateNavigatorSize()) ); } void Navigator::updatePlugins( QList plugins_ ) @@ -368,6 +370,8 @@ if ( !currentPlugin.isEmpty() ) { setCurrentPlugin( currentPlugin ); } + + QTimer::singleShot( 0, this, SLOT(updateNavigatorSize()) ); } void Navigator::setCurrentPlugin( const QString &plugin ) @@ -400,7 +404,7 @@ int viewHeight = QListView::sizeHint().height(); - return QSize( maxWidth + rect().width() - contentsRect().width(), viewHeight ); + return QSize( maxWidth + rect().width() - contentsRect().width()+5, viewHeight ); } void Navigator::dragEnterEvent( QDragEnterEvent *event ) @@ -458,9 +462,7 @@ void Navigator::showEvent( QShowEvent *event ) { - parentWidget()->setMaximumWidth( sizeHint().width() ); - parentWidget()->setMinimumWidth( sizeHint().width() ); - + updateNavigatorSize(); QListView::showEvent( event ); } @@ -511,6 +513,7 @@ { parentWidget()->setMaximumWidth( sizeHint().width() ); parentWidget()->setMinimumWidth( sizeHint().width() ); + parentWidget()->adjustSize(); } IconSidePane::IconSidePane( KontactInterface::Core *core, QWidget *parent ) @@ -536,12 +539,4 @@ mNavigator->updatePlugins( core()->pluginList() ); } -void IconSidePane::resizeEvent( QResizeEvent *event ) -{ - Q_UNUSED( event ); - setMaximumWidth( mNavigator->sizeHint().width() ); - setMinimumWidth( mNavigator->sizeHint().width() ); -} - - // vim: sw=2 sts=2 et tw=80 diff --git a/kontact/src/mainwindow.cpp b/kontact/src/mainwindow.cpp --- a/kontact/src/mainwindow.cpp +++ b/kontact/src/mainwindow.cpp @@ -153,9 +153,6 @@ initGUI(); initObject(); - mSidePane->setMaximumWidth( mSidePane->sizeHint().width() ); - mSidePane->setMinimumWidth( mSidePane->sizeHint().width() ); - factory()->plugActionList( this, QLatin1String( "navigator_actionlist" ), mActionPlugins ); restoreWindowSize( KConfigGroup( KGlobal::config(), "MainWindow" ) );