1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 06:37:35 +00:00

LibGUI: Use themes for syntax highlighting

This commit is contained in:
Oriko 2020-03-16 01:05:06 +02:00 committed by Andreas Kling
parent 6da7fd9aab
commit 2b162ef794
14 changed files with 219 additions and 85 deletions

View file

@ -105,6 +105,18 @@ public:
Color active_link() const { return color(ColorRole::ActiveLink); }
Color visited_link() const { return color(ColorRole::VisitedLink); }
Color syntax_comment() const { return color(ColorRole::SyntaxComment); }
Color syntax_number() const { return color(ColorRole::SyntaxNumber); }
Color syntax_string() const { return color(ColorRole::SyntaxString); }
Color syntax_identifier() const { return color(ColorRole::SyntaxIdentifier); }
Color syntax_type() const { return color(ColorRole::SyntaxType); }
Color syntax_punctuation() const { return color(ColorRole::SyntaxPunctuation); }
Color syntax_operator() const { return color(ColorRole::SyntaxOperator); }
Color syntax_keyword() const { return color(ColorRole::SyntaxKeyword); }
Color syntax_control_keyword() const { return color(ColorRole::SyntaxControlKeyword); }
Color syntax_preprocessor_statement() const { return color(ColorRole::SyntaxPreprocessorStatement); }
Color syntax_preprocessor_value() const { return color(ColorRole::SyntaxPreprocessorValue); }
Color color(ColorRole role) const { return m_impl->color(role); }
void set_color(ColorRole, Color);

View file

@ -114,6 +114,17 @@ RefPtr<SharedBuffer> load_system_theme(const String& path)
DO_COLOR(RulerInactiveText);
DO_COLOR(TextCursor);
DO_COLOR(FocusOutline);
DO_COLOR(SyntaxComment);
DO_COLOR(SyntaxNumber);
DO_COLOR(SyntaxString);
DO_COLOR(SyntaxType);
DO_COLOR(SyntaxPunctuation);
DO_COLOR(SyntaxOperator);
DO_COLOR(SyntaxKeyword);
DO_COLOR(SyntaxControlKeyword);
DO_COLOR(SyntaxIdentifier);
DO_COLOR(SyntaxPreprocessorStatement);
DO_COLOR(SyntaxPreprocessorValue);
buffer->seal();
buffer->share_globally();

View file

@ -77,6 +77,17 @@ enum class ColorRole {
RulerInactiveText,
TextCursor,
FocusOutline,
SyntaxComment,
SyntaxNumber,
SyntaxString,
SyntaxType,
SyntaxPunctuation,
SyntaxOperator,
SyntaxKeyword,
SyntaxControlKeyword,
SyntaxIdentifier,
SyntaxPreprocessorStatement,
SyntaxPreprocessorValue,
__Count,