Commit 54bed745 authored by Adam Strzelecki's avatar Adam Strzelecki Committed by Eike Ziller

Make Enter Find String enabled regardless of Find

Previously Enter Find String (Ctrl+E) required opening Find toolbar at least
once, which is minor but noticeable annoyance.

With this change it always opens Find without focus, so it lines up with Find
Next Selected behavior and also with default Mac behavior. It does also show
yellow highlight for all occurrences without moving cursor.

Task-number: QTCREATORBUG-8993
Change-Id: I1eb8f151d5482895cc49fa5281e7d4e66cf31545
Reviewed-by: default avatarEike Ziller <eike.ziller@digia.com>
parent 0369e2a1
......@@ -353,6 +353,8 @@ void FindToolBar::updateFindAction()
m_findInDocumentAction->setEnabled(enabled);
m_findNextSelectedAction->setEnabled(enabled);
m_findPreviousSelectedAction->setEnabled(enabled);
if (QApplication::clipboard()->supportsFindBuffer())
m_enterFindStringAction->setEnabled(enabled);
}
void FindToolBar::updateToolBar()
......@@ -371,8 +373,6 @@ void FindToolBar::updateToolBar()
m_wholeWordAction->setEnabled(enabled);
m_regularExpressionAction->setEnabled(enabled);
m_preserveCaseAction->setEnabled(replaceEnabled && !hasFindFlag(FindRegularExpression));
if (QApplication::clipboard()->supportsFindBuffer())
m_enterFindStringAction->setEnabled(enabled);
bool replaceFocus = m_ui.replaceEdit->hasFocus();
m_ui.findEdit->setEnabled(enabled);
m_ui.findLabel->setEnabled(enabled);
......@@ -529,6 +529,7 @@ void FindToolBar::invokeResetIncrementalSearch()
void FindToolBar::putSelectionToFindClipboard()
{
openFind(false);
const QString text = m_currentDocumentFind->currentFindString();
QApplication::clipboard()->setText(text, QClipboard::FindBuffer);
setFindText(text);
......
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