mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 07:48:11 +00:00
LibGfx+LibGUI: Allow theming the text cursor
This commit is contained in:
parent
7592f9afd5
commit
c8bc53e987
9 changed files with 9 additions and 1 deletions
|
@ -40,3 +40,4 @@ Ruler=#505050
|
||||||
RulerBorder=#666666
|
RulerBorder=#666666
|
||||||
RulerActiveText=white
|
RulerActiveText=white
|
||||||
RulerInactiveText=#d5d0c7
|
RulerInactiveText=#d5d0c7
|
||||||
|
TextCursor=#9c9cd5
|
||||||
|
|
|
@ -40,3 +40,4 @@ Ruler=#d4d0c8
|
||||||
RulerBorder=#404040
|
RulerBorder=#404040
|
||||||
RulerActiveText=#404040
|
RulerActiveText=#404040
|
||||||
RulerInactiveText=#808080
|
RulerInactiveText=#808080
|
||||||
|
TextCursor=red
|
||||||
|
|
|
@ -40,3 +40,4 @@ Ruler=black
|
||||||
RulerBorder=black
|
RulerBorder=black
|
||||||
RulerActiveText=yellow
|
RulerActiveText=yellow
|
||||||
RulerInactiveText=white
|
RulerInactiveText=white
|
||||||
|
TextCursor=black
|
||||||
|
|
|
@ -40,3 +40,4 @@ Ruler=#434c5e
|
||||||
RulerBorder=#3b4252
|
RulerBorder=#3b4252
|
||||||
RulerActiveText=#95adc5
|
RulerActiveText=#95adc5
|
||||||
RulerInactiveText=#7e9dbc
|
RulerInactiveText=#7e9dbc
|
||||||
|
TextCursor=#7e9dbc
|
||||||
|
|
|
@ -40,3 +40,4 @@ Ruler=#bcc1ae
|
||||||
RulerBorder=#606060
|
RulerBorder=#606060
|
||||||
RulerActiveText=#404040
|
RulerActiveText=#404040
|
||||||
RulerInactiveText=#808080
|
RulerInactiveText=#808080
|
||||||
|
TextCursor=#ee3532
|
||||||
|
|
|
@ -496,7 +496,7 @@ void TextEditor::paint_event(PaintEvent& event)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (is_focused() && m_cursor_state)
|
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)
|
void TextEditor::toggle_selection_if_needed_for_event(const KeyEvent& event)
|
||||||
|
|
|
@ -98,6 +98,7 @@ public:
|
||||||
Color ruler_border() const { return color(ColorRole::RulerBorder); }
|
Color ruler_border() const { return color(ColorRole::RulerBorder); }
|
||||||
Color ruler_active_text() const { return color(ColorRole::RulerActiveText); }
|
Color ruler_active_text() const { return color(ColorRole::RulerActiveText); }
|
||||||
Color ruler_inactive_text() const { return color(ColorRole::RulerInactiveText); }
|
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 link() const { return color(ColorRole::Link); }
|
||||||
Color active_link() const { return color(ColorRole::ActiveLink); }
|
Color active_link() const { return color(ColorRole::ActiveLink); }
|
||||||
|
|
|
@ -112,6 +112,7 @@ RefPtr<SharedBuffer> load_system_theme(const String& path)
|
||||||
DO_COLOR(RulerBorder);
|
DO_COLOR(RulerBorder);
|
||||||
DO_COLOR(RulerActiveText);
|
DO_COLOR(RulerActiveText);
|
||||||
DO_COLOR(RulerInactiveText);
|
DO_COLOR(RulerInactiveText);
|
||||||
|
DO_COLOR(TextCursor);
|
||||||
|
|
||||||
buffer->seal();
|
buffer->seal();
|
||||||
buffer->share_globally();
|
buffer->share_globally();
|
||||||
|
|
|
@ -75,6 +75,7 @@ enum class ColorRole {
|
||||||
RulerBorder,
|
RulerBorder,
|
||||||
RulerActiveText,
|
RulerActiveText,
|
||||||
RulerInactiveText,
|
RulerInactiveText,
|
||||||
|
TextCursor,
|
||||||
|
|
||||||
__Count,
|
__Count,
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue