mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-04 05:20:30 +00:00
LibGUI: Unfocused TextEditors should use inactive selection colors
This commit is contained in:
parent
e455af8d33
commit
7ec1b2e44b
Notes:
sideshowbarker
2024-07-19 09:18:39 +09:00
Author: https://github.com/xTibor Commit: https://github.com/SerenityOS/serenity/commit/7ec1b2e44b4 Pull-request: https://github.com/SerenityOS/serenity/pull/1224
1 changed files with 5 additions and 2 deletions
|
@ -474,7 +474,10 @@ void TextEditor::paint_event(PaintEvent& event)
|
|||
visual_line_rect.height()
|
||||
};
|
||||
|
||||
painter.fill_rect(selection_rect, palette().selection());
|
||||
Color background_color = is_focused() ? palette().selection() : palette().inactive_selection();
|
||||
Color text_color = is_focused() ? palette().selection_text() : palette().inactive_selection_text();
|
||||
|
||||
painter.fill_rect(selection_rect, background_color);
|
||||
|
||||
size_t start_of_selection_within_visual_line = (size_t)max(0, (int)selection_start_column_within_line - (int)start_of_visual_line);
|
||||
size_t end_of_selection_within_visual_line = selection_end_column_within_line - start_of_visual_line;
|
||||
|
@ -484,7 +487,7 @@ void TextEditor::paint_event(PaintEvent& event)
|
|||
end_of_selection_within_visual_line - start_of_selection_within_visual_line
|
||||
};
|
||||
|
||||
painter.draw_text(selection_rect, visual_selected_text, Gfx::TextAlignment::CenterLeft, palette().selection_text());
|
||||
painter.draw_text(selection_rect, visual_selected_text, Gfx::TextAlignment::CenterLeft, text_color);
|
||||
}
|
||||
}
|
||||
++visual_line_index;
|
||||
|
|
Loading…
Reference in a new issue