make the D-Bus call for the search have effect also when in presentation mode;

give focus to the presentation search toolbar when showing it

svn path=/trunk/KDE/kdegraphics/okular/; revision=656256
This commit is contained in:
Pino Toscano 2007-04-20 19:45:33 +00:00
parent 7e3b7236fb
commit 6cf46e9160
5 changed files with 17 additions and 4 deletions

View file

@ -1082,9 +1082,13 @@ void Part::slotFind()
// when in presentation mode, there's already a search bar, taking care of
// the 'find' requests
if ( (PresentationWidget*)m_presentationWidget != 0 )
return;
slotShowFindBar();
{
m_presentationWidget->slotFind();
}
else
{
slotShowFindBar();
}
}

View file

@ -95,6 +95,11 @@ void PresentationSearchBar::forceSnap()
move( m_point.x() - width() / 2, m_point.y() - height() );
}
void PresentationSearchBar::focusOnSearchEdit()
{
m_search->setFocus();
}
void PresentationSearchBar::resizeEvent( QResizeEvent * )
{
// if in snap mode, then force the snap and place ourselves correctly again

View file

@ -28,6 +28,7 @@ class PresentationSearchBar
virtual ~PresentationSearchBar();
void forceSnap();
void focusOnSearchEdit();
protected:
void resizeEvent( QResizeEvent * );

View file

@ -1092,6 +1092,7 @@ void PresentationWidget::slotFind()
m_searchBar = new PresentationSearchBar( m_document, this, this );
m_searchBar->forceSnap();
}
m_searchBar->focusOnSearchEdit();
m_searchBar->show();
}

View file

@ -54,6 +54,9 @@ class PresentationWidget : public QDialog, public Okular::DocumentObserver
// create actions that interact with this widget
void setupActions( KActionCollection * collection );
public slots:
void slotFind();
protected:
// widget events
bool event( QEvent * e );
@ -120,7 +123,6 @@ class PresentationWidget : public QDialog, public Okular::DocumentObserver
void slotPageChanged();
void togglePencilMode( bool );
void clearDrawings();
void slotFind();
};
#endif