diff --git a/NEWS.md b/NEWS.md index a8c9cbe9..a7be0098 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,6 +1,7 @@ Version 0.6.4 - fix: code completion popup not show after '->' inputted - fix: font styles in the color scheme settings not in effect + - fix: editor's font style shouldn't affect gutter's font style Version 0.6.3 - fix: should use c++ syntax to check ".h" files diff --git a/RedPandaIDE/colorscheme.cpp b/RedPandaIDE/colorscheme.cpp index 7098fc65..e0938085 100644 --- a/RedPandaIDE/colorscheme.cpp +++ b/RedPandaIDE/colorscheme.cpp @@ -200,19 +200,19 @@ PColorSchemeItem ColorSchemeItem::fromJson(const QJsonObject &json) item->setBold(false); } if (json.contains("italic") && json["italic"].isBool()) { - item->setBold(json["italic"].toBool()); + item->setItalic(json["italic"].toBool()); } else { item->setItalic(false); } if (json.contains("underlined") && json["underlined"].isBool()) { - item->setBold(json["underlined"].toBool()); + item->setUnderlined(json["underlined"].toBool()); } else { item->setUnderlined(false); } if (json.contains("strikeout") && json["strikeout"].isBool()) { - item->setBold(json["strikeout"].toBool()); + item->setStrikeout(json["strikeout"].toBool()); } else { - item->setUnderlined(false); + item->setStrikeout(false); } return item; } diff --git a/RedPandaIDE/qsynedit/TextPainter.cpp b/RedPandaIDE/qsynedit/TextPainter.cpp index 919d29fa..a797bdf4 100644 --- a/RedPandaIDE/qsynedit/TextPainter.cpp +++ b/RedPandaIDE/qsynedit/TextPainter.cpp @@ -100,6 +100,13 @@ void SynEditTextPainter::paintGutter(const QRect& clip) if (edit->mGutter.useFontStyle()) { painter->setFont(edit->mGutter.font()); + } else { + QFont newFont = painter->font(); + newFont.setBold(false); + newFont.setItalic(false); + newFont.setStrikeOut(false); + newFont.setUnderline(false); + painter->setFont(newFont); } if (edit->mGutter.textColor().isValid()) { painter->setPen(edit->mGutter.textColor());