diff --git a/part.cpp b/part.cpp index ef47318c6..1cfbd15c5 100644 --- a/part.cpp +++ b/part.cpp @@ -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(); + } } diff --git a/ui/presentationsearchbar.cpp b/ui/presentationsearchbar.cpp index a5da3aab1..d20fdc085 100644 --- a/ui/presentationsearchbar.cpp +++ b/ui/presentationsearchbar.cpp @@ -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 diff --git a/ui/presentationsearchbar.h b/ui/presentationsearchbar.h index b4e66b375..f154bdcbd 100644 --- a/ui/presentationsearchbar.h +++ b/ui/presentationsearchbar.h @@ -28,6 +28,7 @@ class PresentationSearchBar virtual ~PresentationSearchBar(); void forceSnap(); + void focusOnSearchEdit(); protected: void resizeEvent( QResizeEvent * ); diff --git a/ui/presentationwidget.cpp b/ui/presentationwidget.cpp index 7e42fe7a5..bdc3bc448 100644 --- a/ui/presentationwidget.cpp +++ b/ui/presentationwidget.cpp @@ -1092,6 +1092,7 @@ void PresentationWidget::slotFind() m_searchBar = new PresentationSearchBar( m_document, this, this ); m_searchBar->forceSnap(); } + m_searchBar->focusOnSearchEdit(); m_searchBar->show(); } diff --git a/ui/presentationwidget.h b/ui/presentationwidget.h index e884aa679..8c607dce5 100644 --- a/ui/presentationwidget.h +++ b/ui/presentationwidget.h @@ -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