After closing an SQL tab, set focus to the new currently selected tab

Suggested in issue #2025
This commit is contained in:
mgrojo
2019-11-03 14:36:58 +01:00
parent 3577c71193
commit f63bcbfef8

View File

@@ -1852,6 +1852,11 @@ void MainWindow::closeSqlTab(int index, bool force)
// Don't let an empty tab widget
if(ui->tabSqlAreas->count() == 0 && !force)
openSqlTab(true);
// Set focus to the currently selected editor tab.
SqlExecutionArea* sqlarea = qobject_cast<SqlExecutionArea*>(ui->tabSqlAreas->currentWidget());
if(sqlarea)
sqlarea->getEditor()->setFocus();
}
int MainWindow::openSqlTab(bool resetCounter)