New setting for configuring brace matching background

This allows modifying this background colour and provides a better
default, which does not make the cursor invisible (in dark mode) and it
is itself visible outside of the current line (in light mode).

See issues #2203 and #2320
This commit is contained in:
mgrojo
2020-07-04 17:08:01 +02:00
parent 0bb3b23070
commit 662dbcf900
4 changed files with 16 additions and 2 deletions
+2
View File
@@ -144,6 +144,8 @@ void ExtendedScintilla::reloadCommonSettings()
}
setPaper(Settings::getValue("syntaxhighlighter", "background_colour").toString());
setColor(Settings::getValue("syntaxhighlighter", "foreground_colour").toString());
setMatchedBraceBackgroundColor(Settings::getValue("syntaxhighlighter", "highlight_colour").toString());
}
void ExtendedScintilla::reloadKeywords()
+1 -1
View File
@@ -122,7 +122,7 @@ void PreferencesDialog::loadSettings()
ui->treeSyntaxHighlighting->topLevelItem(i)->setForeground(2, color);
ui->treeSyntaxHighlighting->topLevelItem(i)->setBackground(2, color);
ui->treeSyntaxHighlighting->topLevelItem(i)->setText(2, colorname);
if (name != "null" && name != "currentline" && name != "background" && name != "foreground") {
if (name != "null" && name != "currentline" && name != "background" && name != "foreground" && name != "highlight") {
ui->treeSyntaxHighlighting->topLevelItem(i)->setCheckState(3, Settings::getValue("syntaxhighlighter", name + "_bold").toBool() ? Qt::Checked : Qt::Unchecked);
ui->treeSyntaxHighlighting->topLevelItem(i)->setCheckState(4, Settings::getValue("syntaxhighlighter", name + "_italic").toBool() ? Qt::Checked : Qt::Unchecked);
ui->treeSyntaxHighlighting->topLevelItem(i)->setCheckState(5, Settings::getValue("syntaxhighlighter", name + "_underline").toBool() ? Qt::Checked : Qt::Unchecked);
+9 -1
View File
@@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>755</width>
<height>594</height>
<height>601</height>
</rect>
</property>
<property name="windowTitle">
@@ -1293,6 +1293,14 @@ Can be set to 0 for disabling completion.</string>
<string>Foreground</string>
</property>
</item>
<item>
<property name="text">
<string>highlight</string>
</property>
<property name="text">
<string>Highlight</string>
</property>
</item>
</widget>
</item>
<item>
+4
View File
@@ -448,6 +448,8 @@ QColor Settings::getDefaultColorValue(const std::string& group, const std::strin
return QColor(Qt::lightGray);
else if(name == "currentline_colour")
return backgroundColour.lighter(150);
else if(name == "highlight_colour")
return QColor(79, 148, 205);
} else {
if(name == "keyword_colour")
return QColor(Qt::darkBlue);
@@ -463,6 +465,8 @@ QColor Settings::getDefaultColorValue(const std::string& group, const std::strin
return QColor(Qt::red);
else if(name == "currentline_colour")
return QColor(236, 236, 245);
else if(name == "highlight_colour")
return QColor(Qt::cyan);
}
}
}