Fixed background display after untoggling spoilers in input fields.
This commit is contained in:
parent
7bd7ada3ff
commit
2d54e9fd35
1 changed files with 5 additions and 1 deletions
|
|
@ -702,6 +702,7 @@ void RemoveDocumentTags(
|
||||||
format.setProperty(kTagProperty, QString());
|
format.setProperty(kTagProperty, QString());
|
||||||
format.setProperty(kReplaceTagId, QString());
|
format.setProperty(kReplaceTagId, QString());
|
||||||
format.setForeground(st.textFg);
|
format.setForeground(st.textFg);
|
||||||
|
format.setBackground(QBrush());
|
||||||
format.setFont(st.font);
|
format.setFont(st.font);
|
||||||
cursor.mergeCharFormat(format);
|
cursor.mergeCharFormat(format);
|
||||||
}
|
}
|
||||||
|
|
@ -748,6 +749,7 @@ void ApplyTagFormat(QTextCharFormat &to, const QTextCharFormat &from) {
|
||||||
to.setProperty(kReplaceTagId, from.property(kReplaceTagId));
|
to.setProperty(kReplaceTagId, from.property(kReplaceTagId));
|
||||||
to.setFont(from.font());
|
to.setFont(from.font());
|
||||||
to.setForeground(from.foreground());
|
to.setForeground(from.foreground());
|
||||||
|
to.setBackground(from.background());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Returns the position of the first inserted tag or "changedEnd" value if none found.
|
// Returns the position of the first inserted tag or "changedEnd" value if none found.
|
||||||
|
|
@ -1435,7 +1437,9 @@ void InputField::updatePalette() {
|
||||||
|
|
||||||
auto format = fragment.charFormat();
|
auto format = fragment.charFormat();
|
||||||
const auto tag = format.property(kTagProperty).toString();
|
const auto tag = format.property(kTagProperty).toString();
|
||||||
format.setForeground(PrepareTagFormat(_st, tag).foreground());
|
const auto updatedFormat = PrepareTagFormat(_st, tag);
|
||||||
|
format.setForeground(updatedFormat.foreground());
|
||||||
|
format.setBackground(updatedFormat.background());
|
||||||
cursor.setPosition(fragment.position());
|
cursor.setPosition(fragment.position());
|
||||||
cursor.setPosition(till, QTextCursor::KeepAnchor);
|
cursor.setPosition(till, QTextCursor::KeepAnchor);
|
||||||
cursor.mergeCharFormat(format);
|
cursor.mergeCharFormat(format);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue