add an option for the tabsize in the sql editor (default 4) · syslogic/sqlitebrowser@d8cdcbd · GitHub
Skip to content

Commit d8cdcbd

Browse files
committed
add an option for the tabsize in the sql editor (default 4)
1 parent cecf681 commit d8cdcbd

4 files changed

Lines changed: 42 additions & 5 deletions

File tree

‎src/MainWindow.cpp‎

Lines changed: 4 additions & 0 deletions

‎src/PreferencesDialog.cpp‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ void PreferencesDialog::loadSettings()
8585
}
8686
}
8787
ui->spinEditorFontSize->setValue(getSettingsValue("editor", "fontsize").toInt());
88+
ui->spinTabSize->setValue(getSettingsValue("editor", "tabsize").toInt());
8889
ui->spinLogFontSize->setValue(getSettingsValue("log", "fontsize").toInt());
8990

9091
ui->listExtensions->addItems(getSettingsValue("extensions", "list").toStringList());
@@ -117,6 +118,7 @@ void PreferencesDialog::saveSettings()
117118
setSettingsValue("syntaxhighlighter", name + "_underline", ui->treeSyntaxHighlighting->topLevelItem(i)->checkState(5) == Qt::Checked);
118119
}
119120
setSettingsValue("editor", "fontsize", ui->spinEditorFontSize->value());
121+
setSettingsValue("editor", "tabsize", ui->spinTabSize->value());
120122
setSettingsValue("log", "fontsize", ui->spinLogFontSize->value());
121123

122124
QStringList extList;
@@ -262,6 +264,14 @@ QVariant PreferencesDialog::getSettingsDefaultValue(const QString& group, const
262264
if((group == "editor" || group == "log") && name == "fontsize")
263265
return 9;
264266

267+
if(group == "editor")
268+
{
269+
if(name == "tabsize")
270+
{
271+
return 4;
272+
}
273+
}
274+
265275
// extensions/list?
266276
if(group == "extensions" && name == "list")
267277
return QStringList();

‎src/PreferencesDialog.ui‎

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -585,20 +585,40 @@ QGroupBox::title {
585585
</property>
586586
</widget>
587587
</item>
588+
<item row="1" column="0">
589+
<widget class="QLabel" name="label_7">
590+
<property name="text">
591+
<string>SQL &amp;log font size</string>
592+
</property>
593+
<property name="buddy">
594+
<cstring>spinLogFontSize</cstring>
595+
</property>
596+
</widget>
597+
</item>
588598
<item row="1" column="1">
589599
<widget class="QSpinBox" name="spinLogFontSize">
590600
<property name="minimum">
591601
<number>1</number>
592602
</property>
593603
</widget>
594604
</item>
595-
<item row="1" column="0">
596-
<widget class="QLabel" name="label_7">
605+
<item row="2" column="0">
606+
<widget class="QLabel" name="label_13">
597607
<property name="text">
598-
<string>SQL &amp;log font size</string>
608+
<string>Tab size:</string>
599609
</property>
600-
<property name="buddy">
601-
<cstring>spinLogFontSize</cstring>
610+
</widget>
611+
</item>
612+
<item row="2" column="1">
613+
<widget class="QSpinBox" name="spinTabSize">
614+
<property name="minimum">
615+
<number>1</number>
616+
</property>
617+
<property name="maximum">
618+
<number>16</number>
619+
</property>
620+
<property name="value">
621+
<number>4</number>
602622
</property>
603623
</widget>
604624
</item>

‎src/sqltextedit.cpp‎

Lines changed: 3 additions & 0 deletions

0 commit comments

Comments
 (0)