Skip to content

Commit

Permalink
fix: support for custom highlight bracket color.
Browse files Browse the repository at this point in the history
Change-Id: I0022810978913f9b331f8a345863a8378e3eb14f
  • Loading branch information
rekols committed Dec 4, 2018
1 parent 5db54ad commit 78d6528
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 9 deletions.
8 changes: 4 additions & 4 deletions src/dtextedit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,6 @@ DTextEdit::DTextEdit(QPlainTextEdit *parent)
{
lineNumberArea = new LineNumberArea(this);

m_bracketMatchFormat = currentCharFormat();
m_bracketMatchFormat.setBackground(Qt::yellow);
m_bracketMatchFormat.setForeground(Qt::black);

viewport()->installEventFilter(this);
viewport()->setCursor(Qt::IBeamCursor);

Expand Down Expand Up @@ -2025,6 +2021,10 @@ void DTextEdit::setTheme(const KSyntaxHighlighting::Theme &theme, const QString
m_selectionColor = QColor(textStylesMap["Normal"].toMap()["selected-text-color"].toString());
m_selectionBgColor = QColor(textStylesMap["Normal"].toMap()["selected-bg-color"].toString());

m_bracketMatchFormat = currentCharFormat();
m_bracketMatchFormat.setForeground(QColor(jsonMap["editor-colors"].toMap()["bracket-match-fg"].toString()));
m_bracketMatchFormat.setBackground(QColor(jsonMap["editor-colors"].toMap()["bracket-match-bg"].toString()));

const QString &styleSheet = QString("QPlainTextEdit {"
"background-color: %1;"
"color: %2;"
Expand Down
3 changes: 2 additions & 1 deletion src/themes/atom_dark.theme
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,8 @@
"editor-colors": {
"background-color" : "#282C34",
"code-folding" : "#224e65",
"bracket-matching" : "#8e44ad",
"bracket-match-bg" : "#ffff00",
"bracket-match-fg" : "#000000",
"current-line" : "#2C323C",
"icon-border" : "#31363b",
"indentation-line" : "#3a3f44",
Expand Down
3 changes: 2 additions & 1 deletion src/themes/breeze_dark.theme
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,8 @@
"editor-colors": {
"background-color" : "#232629",
"code-folding" : "#224e65",
"bracket-matching" : "#8e44ad",
"bracket-match-bg" : "#ffff00",
"bracket-match-fg" : "#000000",
"current-line" : "#2A2E32",
"icon-border" : "#31363b",
"indentation-line" : "#3a3f44",
Expand Down
3 changes: 2 additions & 1 deletion src/themes/deepin.theme
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,8 @@
"editor-colors": {
"background-color" : "#ffffff",
"code-folding" : "#94caef",
"bracket-matching" : "#ffff00",
"bracket-match-bg" : "#ffff00",
"bracket-match-fg" : "#000000",
"current-line" : "#f8f7f6",
"icon-border" : "#f0f0f0",
"indentation-line" : "#d2d2d2",
Expand Down
3 changes: 2 additions & 1 deletion src/themes/solarized_dark.theme
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,8 @@
"editor-colors": {
"background-color" : "#002B36",
"code-folding" : "#224e65",
"bracket-matching" : "#8e44ad",
"bracket-match-bg" : "#ffff00",
"bracket-match-fg" : "#000000",
"current-line" : "#073642",
"icon-border" : "#31363b",
"indentation-line" : "#3a3f44",
Expand Down
3 changes: 2 additions & 1 deletion src/themes/solarized_light.theme
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,8 @@
"editor-colors": {
"background-color" : "#FDF6E3",
"code-folding" : "#224e65",
"bracket-matching" : "#8e44ad",
"bracket-match-bg" : "#ffff00",
"bracket-match-fg" : "#000000",
"current-line" : "#EEE8D5",
"icon-border" : "#31363b",
"indentation-line" : "#3a3f44",
Expand Down

0 comments on commit 78d6528

Please sign in to comment.