mirror of
https://github.com/sqlitebrowser/sqlitebrowser.git
synced 2026-01-20 11:00:44 -06:00
@@ -84,6 +84,7 @@ void PreferencesDialog::loadSettings()
|
||||
ui->treeSyntaxHighlighting->topLevelItem(i)->setCheckState(5, getSettingsValue("syntaxhighlighter", name + "_underline").toBool() ? Qt::Checked : Qt::Unchecked);
|
||||
}
|
||||
}
|
||||
ui->comboEditorFont->setCurrentText(getSettingsValue("editor", "font").toString());
|
||||
ui->spinEditorFontSize->setValue(getSettingsValue("editor", "fontsize").toInt());
|
||||
ui->spinTabSize->setValue(getSettingsValue("editor", "tabsize").toInt());
|
||||
ui->spinLogFontSize->setValue(getSettingsValue("log", "fontsize").toInt());
|
||||
@@ -118,6 +119,7 @@ void PreferencesDialog::saveSettings()
|
||||
setSettingsValue("syntaxhighlighter", name + "_italic", ui->treeSyntaxHighlighting->topLevelItem(i)->checkState(4) == Qt::Checked);
|
||||
setSettingsValue("syntaxhighlighter", name + "_underline", ui->treeSyntaxHighlighting->topLevelItem(i)->checkState(5) == Qt::Checked);
|
||||
}
|
||||
setSettingsValue("editor", "font", ui->comboEditorFont->currentText());
|
||||
setSettingsValue("editor", "fontsize", ui->spinEditorFontSize->value());
|
||||
setSettingsValue("editor", "tabsize", ui->spinTabSize->value());
|
||||
setSettingsValue("log", "fontsize", ui->spinLogFontSize->value());
|
||||
@@ -274,6 +276,10 @@ QVariant PreferencesDialog::getSettingsDefaultValue(const QString& group, const
|
||||
}
|
||||
}
|
||||
|
||||
// editor/font?
|
||||
if(group == "editor" && name == "font")
|
||||
return "Monospace";
|
||||
|
||||
// editor/fontsize or log/fontsize?
|
||||
if((group == "editor" || group == "log") && name == "fontsize")
|
||||
return 9;
|
||||
|
||||
@@ -591,7 +591,7 @@ QGroupBox::title {
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QFormLayout" name="formLayout_2">
|
||||
<item row="0" column="0">
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_6">
|
||||
<property name="text">
|
||||
<string>SQL &editor font size</string>
|
||||
@@ -601,14 +601,14 @@ QGroupBox::title {
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<item row="1" column="1">
|
||||
<widget class="QSpinBox" name="spinEditorFontSize">
|
||||
<property name="minimum">
|
||||
<number>1</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="label_7">
|
||||
<property name="text">
|
||||
<string>SQL &log font size</string>
|
||||
@@ -618,21 +618,24 @@ QGroupBox::title {
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<item row="2" column="1">
|
||||
<widget class="QSpinBox" name="spinLogFontSize">
|
||||
<property name="minimum">
|
||||
<number>1</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="label_13">
|
||||
<property name="text">
|
||||
<string>Tab size:</string>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>spinTabSize</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<item row="3" column="1">
|
||||
<widget class="QSpinBox" name="spinTabSize">
|
||||
<property name="minimum">
|
||||
<number>1</number>
|
||||
@@ -645,6 +648,19 @@ QGroupBox::title {
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label_14">
|
||||
<property name="text">
|
||||
<string>SQL editor &font</string>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>comboEditorFont</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QFontComboBox" name="comboEditorFont"/>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
@@ -741,6 +757,8 @@ QGroupBox::title {
|
||||
</layout>
|
||||
</widget>
|
||||
<tabstops>
|
||||
<tabstop>tabWidget</tabstop>
|
||||
<tabstop>comboDefaultLocation</tabstop>
|
||||
<tabstop>locationEdit</tabstop>
|
||||
<tabstop>setLocationButton</tabstop>
|
||||
<tabstop>languageComboBox</tabstop>
|
||||
@@ -753,13 +771,14 @@ QGroupBox::title {
|
||||
<tabstop>frameNullFgColour</tabstop>
|
||||
<tabstop>frameNullBgColour</tabstop>
|
||||
<tabstop>treeSyntaxHighlighting</tabstop>
|
||||
<tabstop>comboEditorFont</tabstop>
|
||||
<tabstop>spinEditorFontSize</tabstop>
|
||||
<tabstop>spinLogFontSize</tabstop>
|
||||
<tabstop>spinTabSize</tabstop>
|
||||
<tabstop>listExtensions</tabstop>
|
||||
<tabstop>buttonAddExtension</tabstop>
|
||||
<tabstop>buttonRemoveExtension</tabstop>
|
||||
<tabstop>checkRegexDisabled</tabstop>
|
||||
<tabstop>tabWidget</tabstop>
|
||||
</tabstops>
|
||||
<resources>
|
||||
<include location="icons/icons.qrc"/>
|
||||
@@ -805,7 +824,7 @@ QGroupBox::title {
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>119</x>
|
||||
<y>82</y>
|
||||
<y>79</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>245</x>
|
||||
@@ -821,7 +840,7 @@ QGroupBox::title {
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>119</x>
|
||||
<y>82</y>
|
||||
<y>79</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>245</x>
|
||||
@@ -852,8 +871,8 @@ QGroupBox::title {
|
||||
<slot>chooseLocation()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>568</x>
|
||||
<y>71</y>
|
||||
<x>567</x>
|
||||
<y>100</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>294</x>
|
||||
|
||||
@@ -20,7 +20,7 @@ SqlExecutionArea::SqlExecutionArea(QWidget* parent, DBBrowserDB* _db) :
|
||||
ui->setupUi(this);
|
||||
|
||||
// Set font
|
||||
QFont logfont("Monospace");
|
||||
QFont logfont(PreferencesDialog::getSettingsValue("editor", "font").toString());
|
||||
logfont.setStyleHint(QFont::TypeWriter);
|
||||
logfont.setPointSize(PreferencesDialog::getSettingsValue("log", "fontsize").toInt());
|
||||
ui->editErrors->setFont(logfont);
|
||||
|
||||
@@ -87,7 +87,7 @@ void SqlTextEdit::setupSyntaxHighlightingFormat(const QString& settings_name, in
|
||||
{
|
||||
sqlLexer->setColor(QColor(PreferencesDialog::getSettingsValue("syntaxhighlighter", settings_name + "_colour").toString()), style);
|
||||
|
||||
QFont font("Monospace");
|
||||
QFont font(PreferencesDialog::getSettingsValue("editor", "font").toString());
|
||||
font.setPointSize(PreferencesDialog::getSettingsValue("editor", "fontsize").toInt());
|
||||
font.setBold(PreferencesDialog::getSettingsValue("syntaxhighlighter", settings_name + "_bold").toBool());
|
||||
font.setItalic(PreferencesDialog::getSettingsValue("syntaxhighlighter", settings_name + "_italic").toBool());
|
||||
@@ -105,7 +105,7 @@ void SqlTextEdit::reloadSettings()
|
||||
{
|
||||
// Set syntax highlighting settings
|
||||
sqlLexer->setDefaultColor(Qt::black);
|
||||
QFont defaultfont("Monospace");
|
||||
QFont defaultfont(PreferencesDialog::getSettingsValue("editor", "font").toString());
|
||||
defaultfont.setStyleHint(QFont::TypeWriter);
|
||||
defaultfont.setPointSize(PreferencesDialog::getSettingsValue("editor", "fontsize").toInt());
|
||||
sqlLexer->setDefaultFont(defaultfont);
|
||||
@@ -121,13 +121,13 @@ void SqlTextEdit::reloadSettings()
|
||||
setupSyntaxHighlightingFormat("identifier", QsciLexerSQL::QuotedIdentifier);
|
||||
|
||||
// Set font
|
||||
QFont font("Monospace");
|
||||
QFont font(PreferencesDialog::getSettingsValue("editor", "font").toString());
|
||||
font.setStyleHint(QFont::TypeWriter);
|
||||
font.setPointSize(PreferencesDialog::getSettingsValue("editor", "fontsize").toInt());
|
||||
setFont(font);
|
||||
|
||||
// Show line numbers
|
||||
QFont marginsfont(QFont("Monospace"));
|
||||
QFont marginsfont(QFont(PreferencesDialog::getSettingsValue("editor", "font").toString()));
|
||||
marginsfont.setPointSize(font.pointSize());
|
||||
setMarginsFont(marginsfont);
|
||||
setMarginLineNumbers(0, true);
|
||||
|
||||
Reference in New Issue
Block a user