summaryrefslogtreecommitdiff
path: root/src/Preferences.cc
diff options
context:
space:
mode:
authorDon Bright <hugh.m.bright@gmail.com>2013-12-29 21:25:35 (GMT)
committerDon Bright <hugh.m.bright@gmail.com>2013-12-29 21:25:35 (GMT)
commitf0e077269467ea38f54d517f4daea5c014a27df9 (patch)
treee80a5b791ca876673991bd55db95abac95b313c3 /src/Preferences.cc
parent6938ae2dfde578e3980d077adefb86a4bdbd9df1 (diff)
enable disabling of syntax highlighter, add highlighter for dark backgrounds
Diffstat (limited to 'src/Preferences.cc')
-rw-r--r--src/Preferences.cc13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/Preferences.cc b/src/Preferences.cc
index 0f3115e..eed877d 100644
--- a/src/Preferences.cc
+++ b/src/Preferences.cc
@@ -59,6 +59,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;
@@ -86,7 +87,6 @@ Preferences::Preferences(QWidget *parent) : QMainWindow(parent)
this->defaultmap["advanced/openCSGLimit"] = RenderSettings::inst()->openCSGTermLimit;
this->defaultmap["advanced/forceGoldfeather"] = false;
-
// Toolbar
QActionGroup *group = new QActionGroup(this);
group->addAction(prefsAction3DView);
@@ -193,6 +193,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;
@@ -330,6 +337,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());
contact: Jan Huwald // Impressum