diff options
Diffstat (limited to 'src/Preferences.cc')
-rw-r--r-- | src/Preferences.cc | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/Preferences.cc b/src/Preferences.cc index 591ccf6..b63ca7b 100644 --- a/src/Preferences.cc +++ b/src/Preferences.cc @@ -63,6 +63,7 @@ Preferences::Preferences(QWidget *parent) : QMainWindow(parent) QString found_family(QFontInfo(font).family()); this->defaultmap["editor/fontfamily"] = found_family; this->defaultmap["editor/fontsize"] = 12; + this->defaultmap["editor/syntaxhighlight"] = "For Light Background"; uint savedsize = getValue("editor/fontsize").toUInt(); QFontDatabase db; @@ -280,6 +281,13 @@ void Preferences::on_fontSize_editTextChanged(const QString &size) emit fontChanged(getValue("editor/fontfamily").toString(), intsize); } +void Preferences::on_syntaxHighlight_currentIndexChanged(const QString &s) +{ + QSettings settings; + settings.setValue("editor/syntaxhighlight", s); + emit syntaxHighlightChanged(s); +} + void unimplemented_msg() { QMessageBox mbox; @@ -416,6 +424,10 @@ void Preferences::updateGUI() this->fontSize->setEditText(fontsize); } + QString shighlight = getValue("editor/syntaxhighlight").toString(); + int shidx = this->syntaxHighlight->findText(shighlight); + if (shidx >= 0) this->syntaxHighlight->setCurrentIndex(shidx); + if (AutoUpdater *updater = AutoUpdater::updater()) { this->updateCheckBox->setChecked(updater->automaticallyChecksForUpdates()); this->snapshotCheckBox->setChecked(updater->enableSnapshots()); |