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
remotes/origin/KDE/4.3
Pino Toscano 17 years ago
parent 3a31169487
commit a84db251c4
  1. 6
      part.cpp
  2. 14
      ui/findbar.cpp
  3. 1
      ui/findbar.h

@ -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();

Loading…
Cancel
Save