mirror of
https://github.com/sqlitebrowser/sqlitebrowser.git
synced 2026-01-20 11:00:44 -06:00
Use Ctrl+W to close a tab in SQL editor and Ctrl+F4 to close DB file
See enhancement #2025
This commit is contained in:
@@ -215,6 +215,12 @@ void MainWindow::init()
|
||||
QShortcut* shortcutPrint = new QShortcut(QKeySequence(QKeySequence::Print), ui->dbTreeWidget, nullptr, nullptr, Qt::WidgetShortcut);
|
||||
connect(shortcutPrint, &QShortcut::activated, this, &MainWindow::printDbStructure);
|
||||
|
||||
QShortcut* closeTabShortcut = new QShortcut(tr("Ctrl+W"), ui->tabSqlAreas, nullptr, nullptr, Qt::WidgetWithChildrenShortcut);
|
||||
connect(closeTabShortcut, &QShortcut::activated, this, [this]() {
|
||||
if(ui->tabSqlAreas->currentIndex() > 0)
|
||||
closeSqlTab(ui->tabSqlAreas->currentIndex());
|
||||
});
|
||||
|
||||
// Create the actions for the recently opened dbs list
|
||||
for(int i = 0; i < MaxRecentFiles; ++i) {
|
||||
recentFileActs[i] = new QAction(this);
|
||||
@@ -3267,6 +3273,7 @@ void MainWindow::showContextMenuSqlTabBar(const QPoint& pos)
|
||||
|
||||
QAction* actionClose = new QAction(this);
|
||||
actionClose->setText(tr("Close Tab"));
|
||||
actionClose->setShortcut(tr("Ctrl+W"));
|
||||
connect(actionClose, &QAction::triggered, [this, tab]() {
|
||||
closeSqlTab(tab);
|
||||
});
|
||||
|
||||
@@ -1187,7 +1187,7 @@ You can drag SQL statements from the Schema column and drop them into the SQL ed
|
||||
<string>This button closes the connection to the currently open database file</string>
|
||||
</property>
|
||||
<property name="shortcut">
|
||||
<string>Ctrl+W</string>
|
||||
<string>Ctrl+F4</string>
|
||||
</property>
|
||||
<property name="menuRole">
|
||||
<enum>QAction::NoRole</enum>
|
||||
|
||||
Reference in New Issue
Block a user