Commit 5f44d8f5 authored by Eike Ziller's avatar Eike Ziller

More Esc fixes.

Move focus back to editor's focus widget if there's one.
(E.g. pressing escape in an output pane while the
commit editor is open.)

Change-Id: I4211a84cfa3d7ee9b61f39ae054fc4bd32e214c1
Reviewed-by: default avatarDaniel Teske <daniel.teske@nokia.com>
parent 67ab31c2
......@@ -897,8 +897,11 @@ void MainWindow::setFocusToEditor()
// give focus to the editor if we have one
if (IEditor *editor = m_editorManager->currentEditor()) {
if (qApp->focusWidget() != editor->widget()->focusWidget()) {
editor->widget()->setFocus();
focusWasMovedToEditor = editor->widget()->hasFocus();
QWidget *w = editor->widget()->focusWidget();
if (!w)
w = editor->widget();
w->setFocus();
focusWasMovedToEditor = w->hasFocus();
}
}
......
......@@ -386,8 +386,12 @@ void OutputPaneManager::slotHide()
m_buttons.value(idx)->setChecked(false);
if (m_pageMap.value(idx))
m_pageMap.value(idx)->visibilityChanged(false);
if (IEditor *editor = Core::EditorManager::instance()->currentEditor())
editor->widget()->setFocus();
if (IEditor *editor = Core::EditorManager::instance()->currentEditor()) {
QWidget *w = editor->widget()->focusWidget();
if (!w)
w = editor->widget();
w->setFocus();
}
}
}
......
......@@ -221,7 +221,10 @@ void CurrentDocumentFind::clearFindSupport()
bool CurrentDocumentFind::setFocusToCurrentFindSupport()
{
if (m_currentFind && m_currentWidget) {
m_currentWidget->setFocus();
QWidget *w = m_currentWidget->focusWidget();
if (!w)
w = m_currentWidget;
w->setFocus();
return true;
}
return false;
......
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