mirror of
https://invent.kde.org/graphics/okular
synced 2024-08-27 11:40:07 +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
|
// when in presentation mode, there's already a search bar, taking care of
|
||||||
// the 'find' requests
|
// the 'find' requests
|
||||||
if ( (PresentationWidget*)m_presentationWidget != 0 )
|
if ( (PresentationWidget*)m_presentationWidget != 0 )
|
||||||
return;
|
{
|
||||||
|
m_presentationWidget->slotFind();
|
||||||
slotShowFindBar();
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
slotShowFindBar();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -95,6 +95,11 @@ void PresentationSearchBar::forceSnap()
|
||||||
move( m_point.x() - width() / 2, m_point.y() - height() );
|
move( m_point.x() - width() / 2, m_point.y() - height() );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void PresentationSearchBar::focusOnSearchEdit()
|
||||||
|
{
|
||||||
|
m_search->setFocus();
|
||||||
|
}
|
||||||
|
|
||||||
void PresentationSearchBar::resizeEvent( QResizeEvent * )
|
void PresentationSearchBar::resizeEvent( QResizeEvent * )
|
||||||
{
|
{
|
||||||
// if in snap mode, then force the snap and place ourselves correctly again
|
// if in snap mode, then force the snap and place ourselves correctly again
|
||||||
|
|
|
@ -28,6 +28,7 @@ class PresentationSearchBar
|
||||||
virtual ~PresentationSearchBar();
|
virtual ~PresentationSearchBar();
|
||||||
|
|
||||||
void forceSnap();
|
void forceSnap();
|
||||||
|
void focusOnSearchEdit();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void resizeEvent( QResizeEvent * );
|
void resizeEvent( QResizeEvent * );
|
||||||
|
|
|
@ -1092,6 +1092,7 @@ void PresentationWidget::slotFind()
|
||||||
m_searchBar = new PresentationSearchBar( m_document, this, this );
|
m_searchBar = new PresentationSearchBar( m_document, this, this );
|
||||||
m_searchBar->forceSnap();
|
m_searchBar->forceSnap();
|
||||||
}
|
}
|
||||||
|
m_searchBar->focusOnSearchEdit();
|
||||||
m_searchBar->show();
|
m_searchBar->show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -54,6 +54,9 @@ class PresentationWidget : public QDialog, public Okular::DocumentObserver
|
||||||
// create actions that interact with this widget
|
// create actions that interact with this widget
|
||||||
void setupActions( KActionCollection * collection );
|
void setupActions( KActionCollection * collection );
|
||||||
|
|
||||||
|
public slots:
|
||||||
|
void slotFind();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// widget events
|
// widget events
|
||||||
bool event( QEvent * e );
|
bool event( QEvent * e );
|
||||||
|
@ -120,7 +123,6 @@ class PresentationWidget : public QDialog, public Okular::DocumentObserver
|
||||||
void slotPageChanged();
|
void slotPageChanged();
|
||||||
void togglePencilMode( bool );
|
void togglePencilMode( bool );
|
||||||
void clearDrawings();
|
void clearDrawings();
|
||||||
void slotFind();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in a new issue