Find: Fix that pressing escape when tool bar is disabled did nothing

Change-Id: Ic8f3c897aa77bff2d1bb393186634418ff0d8d80
Task-number: QTCREATORBUG-12710
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
This commit is contained in:
Eike Ziller
2014-07-23 11:23:09 +02:00
parent 6e333f0607
commit cec2319e9a
2 changed files with 5 additions and 5 deletions

View File

@@ -348,8 +348,6 @@ void FindToolBar::updateToolBar()
bool replaceEnabled = enabled && m_currentDocumentFind->supportsReplace();
bool showAllControls = canShowAllControls(replaceEnabled);
m_goToCurrentFindAction->setEnabled(enabled);
m_findNextAction->setEnabled(enabled);
m_findPreviousAction->setEnabled(enabled);
@@ -618,9 +616,11 @@ void FindToolBar::updateFlagMenus()
m_preserveCaseAction->setEnabled((supportedFlags & FindPreserveCase) && !regexp && replaceEnabled);
}
bool FindToolBar::setFocusToCurrentFindSupport()
void FindToolBar::setFocusToCurrentFindSupport()
{
return m_currentDocumentFind->setFocusToCurrentFindSupport();
if (!m_currentDocumentFind->setFocusToCurrentFindSupport())
if (QWidget *w = focusWidget())
w->clearFocus();
}
void FindToolBar::hideAndResetFocus()

View File

@@ -119,7 +119,7 @@ private slots:
void adaptToCandidate();
bool setFocusToCurrentFindSupport();
void setFocusToCurrentFindSupport();
protected:
bool focusNextPrevChild(bool next);