From e130fc41ed66a2bfef578d568890a44586c98fc5 Mon Sep 17 00:00:00 2001 From: Leo Franchi Date: Wed, 1 Jun 2011 20:29:54 -0400 Subject: [PATCH] resize dialog when it changes size, and hide/show otherwise osx goes CRAZY PANTS --- src/delegateconfigwrapper.h | 11 +++++++++++ src/sip/twitter/twitterconfigwidget.cpp | 2 ++ src/sip/twitter/twitterconfigwidget.h | 1 + 3 files changed, 14 insertions(+) diff --git a/src/delegateconfigwrapper.h b/src/delegateconfigwrapper.h index 463261deb..6dc40700a 100644 --- a/src/delegateconfigwrapper.h +++ b/src/delegateconfigwrapper.h @@ -47,6 +47,8 @@ public: setSizeGripEnabled( false ); setMinimumSize( sizeHint() ); setMaximumSize( sizeHint() ); // to remove the resize grip on osx this is the only way + + connect( conf, SIGNAL( sizeHintChanged() ), this, SLOT( updateSizeHint() ) ); #endif } public slots: @@ -72,6 +74,15 @@ public slots: m_widget->setVisible( false ); } + void updateSizeHint() { + hide(); + setSizeGripEnabled( false ); + setMinimumSize( sizeHint() ); + setMaximumSize( sizeHint() ); + + show(); + } + private: QWidget* m_widget; }; diff --git a/src/sip/twitter/twitterconfigwidget.cpp b/src/sip/twitter/twitterconfigwidget.cpp index 115147cd9..ddf5e89df 100644 --- a/src/sip/twitter/twitterconfigwidget.cpp +++ b/src/sip/twitter/twitterconfigwidget.cpp @@ -132,6 +132,7 @@ TwitterConfigWidget::authenticateVerifyReply( const QTweetUser &user ) m_plugin->connectPlugin( false ); emit twitterAuthed( true ); + emit sizeHintChanged(); } void @@ -161,6 +162,7 @@ TwitterConfigWidget::deauthenticateTwitter() ui->twitterTweetComboBox->setVisible( false ); emit twitterAuthed( false ); + emit sizeHintChanged(); } void diff --git a/src/sip/twitter/twitterconfigwidget.h b/src/sip/twitter/twitterconfigwidget.h index 5de30c7a7..d06c08737 100644 --- a/src/sip/twitter/twitterconfigwidget.h +++ b/src/sip/twitter/twitterconfigwidget.h @@ -45,6 +45,7 @@ public: signals: void twitterAuthed( bool authed ); + void sizeHintChanged(); private slots: void authDeauthTwitter(); void startPostGotTomahawkStatus();