- fix: editor's font style shouldn't affect gutter's font style

This commit is contained in:
royqh1979@gmail.com 2021-10-10 21:46:11 +08:00
parent 8599190d13
commit b3fb9e223b
3 changed files with 12 additions and 4 deletions

View File

@ -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

View File

@ -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;
}

View File

@ -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());