Commit a84db251 authored by Pino Toscano's avatar Pino Toscano

Instead of directly closing the find bar with Esc, check whether a search is running from it.

In case it is, then cancel it, otherwise just close the find bar.
This make it possible to cancel a running search in the find bar without waiting for it to find some match and stop.

svn path=/trunk/KDE/kdegraphics/okular/; revision=965461
parent 3a311694
......@@ -1255,8 +1255,10 @@ void Part::slotShowFindBar()
void Part::slotHideFindBar()
{
m_findBar->hide();
m_pageView->setFocus();
if ( m_findBar->maybeHide() )
{
m_pageView->setFocus();
}
}
//BEGIN go to page dialog
......
......@@ -106,6 +106,20 @@ void FindBar::focusAndSetCursor()
m_search->lineEdit()->setFocus();
}
bool FindBar::maybeHide()
{
if ( m_search->lineEdit()->isSearchRunning() )
{
m_search->lineEdit()->stopSearch();
return false;
}
else
{
hide();
return true;
}
}
void FindBar::findNext()
{
m_search->lineEdit()->setSearchType( Okular::Document::NextMatch );
......
......@@ -32,6 +32,7 @@ class FindBar
Qt::CaseSensitivity caseSensitivity() const;
void focusAndSetCursor();
bool maybeHide();
public slots:
void findNext();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment