mirror of
https://github.com/sqlitebrowser/sqlitebrowser.git
synced 2026-01-21 03:21:43 -06:00
New setting for having close button on tabs (default) or not
Corner widget has been removed, since it has been agreed that it is too stray from the tabs. See issues #1968 and #2155
This commit is contained in:
@@ -358,16 +358,6 @@ 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);
|
||||
@@ -2164,6 +2154,8 @@ void MainWindow::reloadSettings()
|
||||
remoteDock->reloadSettings();
|
||||
|
||||
sqlb::setIdentifierQuoting(static_cast<sqlb::escapeQuoting>(Settings::getValue("editor", "identifier_quotes").toInt()));
|
||||
|
||||
ui->tabSqlAreas->setTabsClosable(Settings::getValue("editor", "close_button_on_tabs").toBool());
|
||||
}
|
||||
|
||||
void MainWindow::checkNewVersion(const QString& versionstring, const QString& url)
|
||||
|
||||
@@ -186,6 +186,7 @@ void PreferencesDialog::loadSettings()
|
||||
ui->checkCompleteUpper->setChecked(Settings::getValue("editor", "upper_keywords").toBool());
|
||||
ui->checkErrorIndicators->setChecked(Settings::getValue("editor", "error_indicators").toBool());
|
||||
ui->checkHorizontalTiling->setChecked(Settings::getValue("editor", "horizontal_tiling").toBool());
|
||||
ui->checkCloseButtonOnTabs->setChecked(Settings::getValue("editor", "close_button_on_tabs").toBool());
|
||||
|
||||
ui->listExtensions->addItems(Settings::getValue("extensions", "list").toStringList());
|
||||
ui->checkRegexDisabled->setChecked(Settings::getValue("extensions", "disableregex").toBool());
|
||||
@@ -249,6 +250,7 @@ void PreferencesDialog::saveSettings()
|
||||
Settings::setValue("editor", "upper_keywords", ui->checkCompleteUpper->isChecked());
|
||||
Settings::setValue("editor", "error_indicators", ui->checkErrorIndicators->isChecked());
|
||||
Settings::setValue("editor", "horizontal_tiling", ui->checkHorizontalTiling->isChecked());
|
||||
Settings::setValue("editor", "close_button_on_tabs", ui->checkCloseButtonOnTabs->isChecked());
|
||||
|
||||
QStringList extList;
|
||||
for(const QListWidgetItem* item : ui->listExtensions->findItems(QString("*"), Qt::MatchWrap | Qt::MatchWildcard))
|
||||
|
||||
@@ -1520,6 +1520,26 @@ Can be set to 0 for disabling completion.</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="9" column="0">
|
||||
<widget class="QLabel" name="labelCloseButtonOnTabs">
|
||||
<property name="text">
|
||||
<string>Close button on tabs</string>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>checkCloseButtonOnTabs</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="9" column="1">
|
||||
<widget class="QCheckBox" name="checkCloseButtonOnTabs">
|
||||
<property name="toolTip">
|
||||
<string>If enabled, SQL editor tabs will have a close button. In any case, you can use the contextual menu or the keyboard shortcut to close them.</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>enabled</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
@@ -1910,6 +1930,7 @@ Can be set to 0 for disabling completion.</string>
|
||||
<tabstop>checkCompleteUpper</tabstop>
|
||||
<tabstop>checkErrorIndicators</tabstop>
|
||||
<tabstop>checkHorizontalTiling</tabstop>
|
||||
<tabstop>checkCloseButtonOnTabs</tabstop>
|
||||
<tabstop>listExtensions</tabstop>
|
||||
<tabstop>buttonAddExtension</tabstop>
|
||||
<tabstop>buttonRemoveExtension</tabstop>
|
||||
|
||||
@@ -305,6 +305,10 @@ QVariant Settings::getDefaultValue(const std::string& group, const std::string&
|
||||
if(group == "editor" && name == "splitter2_sizes")
|
||||
return QVariant();
|
||||
|
||||
// editor/close_button_on_tabs?
|
||||
if(group == "editor" && name == "close_button_on_tabs")
|
||||
return true;
|
||||
|
||||
// extensions/list?
|
||||
if(group == "extensions" && name == "list")
|
||||
return QStringList();
|
||||
|
||||
Reference in New Issue
Block a user