summaryrefslogtreecommitdiff
path: root/src/Preferences.cc
diff options
context:
space:
mode:
authorMarius Kintel <marius@kintel.net>2013-12-29 23:37:29 (GMT)
committerMarius Kintel <marius@kintel.net>2013-12-29 23:37:29 (GMT)
commitbf193472481d3e708da841d59df5f323e2785db7 (patch)
treeef8c6e33569ffdaed9af524500c7c8ede633c05a /src/Preferences.cc
parent9ea82e746cf4ff4c5c081e82fc0248d4d575ffdb (diff)
parent81a08c05c2d03aa8791279dfbcf7f9ca826fcf96 (diff)
Merge pull request #580 from openscad/colorsfix
Colorsfix - 3 options for syntax highlighter
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