mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-21 03:55:24 +00:00
LibGfx+LibGUI: Allow theming the text cursor
This commit is contained in:
parent
7592f9afd5
commit
c8bc53e987
Notes:
sideshowbarker
2024-07-19 09:12:13 +09:00
Author: https://github.com/xTibor Commit: https://github.com/SerenityOS/serenity/commit/c8bc53e9874 Pull-request: https://github.com/SerenityOS/serenity/pull/1255
9 changed files with 9 additions and 1 deletions
|
@ -40,3 +40,4 @@ Ruler=#505050
|
|||
RulerBorder=#666666
|
||||
RulerActiveText=white
|
||||
RulerInactiveText=#d5d0c7
|
||||
TextCursor=#9c9cd5
|
||||
|
|
|
@ -40,3 +40,4 @@ Ruler=#d4d0c8
|
|||
RulerBorder=#404040
|
||||
RulerActiveText=#404040
|
||||
RulerInactiveText=#808080
|
||||
TextCursor=red
|
||||
|
|
|
@ -40,3 +40,4 @@ Ruler=black
|
|||
RulerBorder=black
|
||||
RulerActiveText=yellow
|
||||
RulerInactiveText=white
|
||||
TextCursor=black
|
||||
|
|
|
@ -40,3 +40,4 @@ Ruler=#434c5e
|
|||
RulerBorder=#3b4252
|
||||
RulerActiveText=#95adc5
|
||||
RulerInactiveText=#7e9dbc
|
||||
TextCursor=#7e9dbc
|
||||
|
|
|
@ -40,3 +40,4 @@ Ruler=#bcc1ae
|
|||
RulerBorder=#606060
|
||||
RulerActiveText=#404040
|
||||
RulerInactiveText=#808080
|
||||
TextCursor=#ee3532
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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); }
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -75,6 +75,7 @@ enum class ColorRole {
|
|||
RulerBorder,
|
||||
RulerActiveText,
|
||||
RulerInactiveText,
|
||||
TextCursor,
|
||||
|
||||
__Count,
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue