diff --git a/ui/presentationsearchbar.cpp b/ui/presentationsearchbar.cpp index 615fcc89c..74656971d 100644 --- a/ui/presentationsearchbar.cpp +++ b/ui/presentationsearchbar.cpp @@ -76,9 +76,6 @@ PresentationSearchBar::PresentationSearchBar( Okular::Document *document, QWidge m_anchor->installEventFilter( this ); connect( closeBtn, SIGNAL( clicked() ), this, SLOT( close() ) ); - - // force the initial snap - forceSnap(); } PresentationSearchBar::~PresentationSearchBar() @@ -92,6 +89,13 @@ void PresentationSearchBar::forceSnap() move( m_point.x() - width() / 2, m_point.y() - height() ); } +void PresentationSearchBar::resizeEvent( QResizeEvent * ) +{ + // if in snap mode, then force the snap and place ourselves correctly again + if ( m_snapped ) + forceSnap(); +} + bool PresentationSearchBar::eventFilter( QObject *obj, QEvent *e ) { if ( obj == m_handle && diff --git a/ui/presentationsearchbar.h b/ui/presentationsearchbar.h index 2aca56b7c..b4e66b375 100644 --- a/ui/presentationsearchbar.h +++ b/ui/presentationsearchbar.h @@ -30,6 +30,7 @@ class PresentationSearchBar void forceSnap(); protected: + void resizeEvent( QResizeEvent * ); bool eventFilter( QObject *, QEvent * ); private: