LibGfx+LibGUI: Allow theming the text cursor

This commit is contained in:
Tibor Nagy 2020-02-20 09:01:48 +01:00 committed by Andreas Kling
parent 7592f9afd5
commit c8bc53e987
Notes: sideshowbarker 2024-07-19 09:12:13 +09:00
9 changed files with 9 additions and 1 deletions

View File

@ -40,3 +40,4 @@ Ruler=#505050
RulerBorder=#666666
RulerActiveText=white
RulerInactiveText=#d5d0c7
TextCursor=#9c9cd5

View File

@ -40,3 +40,4 @@ Ruler=#d4d0c8
RulerBorder=#404040
RulerActiveText=#404040
RulerInactiveText=#808080
TextCursor=red

View File

@ -40,3 +40,4 @@ Ruler=black
RulerBorder=black
RulerActiveText=yellow
RulerInactiveText=white
TextCursor=black

View File

@ -40,3 +40,4 @@ Ruler=#434c5e
RulerBorder=#3b4252
RulerActiveText=#95adc5
RulerInactiveText=#7e9dbc
TextCursor=#7e9dbc

View File

@ -40,3 +40,4 @@ Ruler=#bcc1ae
RulerBorder=#606060
RulerActiveText=#404040
RulerInactiveText=#808080
TextCursor=#ee3532

View File

@ -496,7 +496,7 @@ void TextEditor::paint_event(PaintEvent& event)
}
if (is_focused() && m_cursor_state)
painter.fill_rect(cursor_content_rect(), Color::Red);
painter.fill_rect(cursor_content_rect(), palette().text_cursor());
}
void TextEditor::toggle_selection_if_needed_for_event(const KeyEvent& event)

View File

@ -98,6 +98,7 @@ public:
Color ruler_border() const { return color(ColorRole::RulerBorder); }
Color ruler_active_text() const { return color(ColorRole::RulerActiveText); }
Color ruler_inactive_text() const { return color(ColorRole::RulerInactiveText); }
Color text_cursor() const { return color(ColorRole::TextCursor); }
Color link() const { return color(ColorRole::Link); }
Color active_link() const { return color(ColorRole::ActiveLink); }

View File

@ -112,6 +112,7 @@ RefPtr<SharedBuffer> load_system_theme(const String& path)
DO_COLOR(RulerBorder);
DO_COLOR(RulerActiveText);
DO_COLOR(RulerInactiveText);
DO_COLOR(TextCursor);
buffer->seal();
buffer->share_globally();

View File

@ -75,6 +75,7 @@ enum class ColorRole {
RulerBorder,
RulerActiveText,
RulerInactiveText,
TextCursor,
__Count,