mirror of
https://invent.kde.org/graphics/okular
synced 2024-08-27 03:30:20 +00:00
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:
parent
7e3b7236fb
commit
6cf46e9160
10
part.cpp
10
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();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -28,6 +28,7 @@ class PresentationSearchBar
|
|||
virtual ~PresentationSearchBar();
|
||||
|
||||
void forceSnap();
|
||||
void focusOnSearchEdit();
|
||||
|
||||
protected:
|
||||
void resizeEvent( QResizeEvent * );
|
||||
|
|
|
@ -1092,6 +1092,7 @@ void PresentationWidget::slotFind()
|
|||
m_searchBar = new PresentationSearchBar( m_document, this, this );
|
||||
m_searchBar->forceSnap();
|
||||
}
|
||||
m_searchBar->focusOnSearchEdit();
|
||||
m_searchBar->show();
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue