1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-16 11:37:39 +00:00

LibGfx: Add Gfx::TextAttributes (and use it in GUI::TextDocumentSpan)

This commit is contained in:
Andreas Kling 2021-01-02 20:31:45 +01:00
parent 0d44ee6f2b
commit 05f5d0dda3
11 changed files with 127 additions and 83 deletions

View file

@ -100,8 +100,8 @@ void JSSyntaxHighlighter::rehighlight(Gfx::Palette palette)
span.range.set_end({ position.line(), position.column() });
auto type = is_trivia ? JS::TokenType::Invalid : token.type();
auto style = style_for_token_type(palette, type);
span.color = style.color;
span.bold = style.bold;
span.attributes.color = style.color;
span.attributes.bold = style.bold;
span.is_skippable = is_trivia;
span.data = reinterpret_cast<void*>(static_cast<size_t>(type));
spans.append(span);