Specify full TextStyles in EditorStyle

This commit is contained in:
Nathan Sobo
2021-09-16 14:12:38 -06:00
parent c21b754c4c
commit a1f0693599
5 changed files with 86 additions and 79 deletions
+10
View File
@@ -126,6 +126,16 @@ impl TextStyle {
}
}
impl From<TextStyle> for HighlightStyle {
fn from(other: TextStyle) -> Self {
Self {
color: other.color,
font_properties: other.font_properties,
underline: other.underline,
}
}
}
impl HighlightStyle {
fn from_json(json: HighlightStyleJson) -> Self {
let font_properties = properties_from_json(json.weight, json.italic);