keep the right position when we resize

svn path=/trunk/playground/graphics/okular/; revision=645759
remotes/origin/KDE/4.0
Pino Toscano 19 years ago
parent 0c1b5314e9
commit 38c0e26674
  1. 10
      ui/presentationsearchbar.cpp
  2. 1
      ui/presentationsearchbar.h

@ -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 &&

@ -30,6 +30,7 @@ class PresentationSearchBar
void forceSnap();
protected:
void resizeEvent( QResizeEvent * );
bool eventFilter( QObject *, QEvent * );
private:

Loading…
Cancel
Save