mirror of
https://github.com/sqlitebrowser/sqlitebrowser.git
synced 2026-01-20 02:50:46 -06:00
Apply find bar visibility to all SQL tabs
If multiple SQL tabs are opened, show or hide the find bar for all of them when changing the check state of the button. Also apply the find bar state to newly opened SQL tabs. This also fixes a crash which would happen if you click the Find button prior to opening any SQL tabs, i.e. before opening the first database file.
This commit is contained in:
@@ -1716,6 +1716,7 @@ unsigned int MainWindow::openSqlTab(bool resetCounter)
|
||||
SqlExecutionArea* w = new SqlExecutionArea(db, this);
|
||||
int index = ui->tabSqlAreas->addTab(w, QString("SQL %1").arg(++tabNumber));
|
||||
ui->tabSqlAreas->setCurrentIndex(index);
|
||||
w->setFindFrameVisibility(ui->actionSqlFind->isChecked());
|
||||
w->getEditor()->setFocus();
|
||||
|
||||
return index;
|
||||
@@ -2637,6 +2638,6 @@ void MainWindow::renameSqlTab(int index)
|
||||
|
||||
void MainWindow::setFindFrameVisibility(bool show)
|
||||
{
|
||||
qobject_cast<SqlExecutionArea*>(ui->tabSqlAreas->currentWidget())->setFindFrameVisibility(show);
|
||||
|
||||
for(int i=0;i<ui->tabSqlAreas->count();i++)
|
||||
qobject_cast<SqlExecutionArea*>(ui->tabSqlAreas->widget(i))->setFindFrameVisibility(show);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user