mirror of
https://github.com/sqlitebrowser/sqlitebrowser.git
synced 2026-01-20 02:50:46 -06:00
Remove close buttons on tabs and add button for closing SQL tabs
This gives us some more space in the tab bar and should reduce the risk of accidentally closing a tab. It looks prettier too. We could add an option for this in the Preferences dialog but in order to not add too many rarely used options, let's try it without an option first. See issue #1968.
This commit is contained in:
@@ -333,6 +333,16 @@ void MainWindow::init()
|
||||
QShortcut* setTab4Shortcut = new QShortcut(QKeySequence("Alt+4"), this);
|
||||
connect(setTab4Shortcut, &QShortcut::activated, [this]() { ui->mainTab->setCurrentIndex(3); });
|
||||
|
||||
// Add button to close Execute SQL tabs
|
||||
QToolButton* buttonCloseSqlTab = new QToolButton(ui->tabSqlAreas);
|
||||
buttonCloseSqlTab->setIcon(QIcon(":icons/close"));
|
||||
buttonCloseSqlTab->setToolTip(tr("Close current SQL tab"));
|
||||
buttonCloseSqlTab->setAutoRaise(true);
|
||||
connect(buttonCloseSqlTab, &QToolButton::clicked, [this]() {
|
||||
closeSqlTab(ui->tabSqlAreas->currentIndex());
|
||||
});
|
||||
ui->tabSqlAreas->setCornerWidget(buttonCloseSqlTab);
|
||||
|
||||
// If we're not compiling in SQLCipher, hide its FAQ link in the help menu
|
||||
#ifndef ENABLE_SQLCIPHER
|
||||
ui->actionSqlCipherFaq->setVisible(false);
|
||||
|
||||
@@ -39,9 +39,6 @@
|
||||
<property name="currentIndex">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="tabsClosable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="movable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
@@ -727,9 +724,6 @@ You can drag SQL statements from an object row and drop them into other applicat
|
||||
<property name="currentIndex">
|
||||
<number>-1</number>
|
||||
</property>
|
||||
<property name="tabsClosable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="movable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
|
||||
Reference in New Issue
Block a user