mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-28 11:49:44 +00:00
LibGUI: Use inactive selection colors from palette instead of hardcoding them
This commit is contained in:
parent
99192fd29f
commit
4d95163400
Notes:
sideshowbarker
2024-07-19 09:18:46 +09:00
Author: https://github.com/xTibor
Commit: 4d95163400
Pull-request: https://github.com/SerenityOS/serenity/pull/1224
5 changed files with 14 additions and 12 deletions
|
@ -126,7 +126,7 @@ void ListView::paint_event(PaintEvent& event)
|
|||
|
||||
Color background_color;
|
||||
if (is_selected_row) {
|
||||
background_color = is_focused() ? palette().selection() : Color::from_rgb(0x606060);
|
||||
background_color = is_focused() ? palette().selection() : palette().inactive_selection();
|
||||
} else {
|
||||
Color row_fill_color = palette().color(background_role());
|
||||
if (alternating_row_colors() && (painted_item_index % 2)) {
|
||||
|
@ -151,7 +151,7 @@ void ListView::paint_event(PaintEvent& event)
|
|||
} else {
|
||||
Color text_color;
|
||||
if (is_selected_row)
|
||||
text_color = palette().selection_text();
|
||||
text_color = is_focused() ? palette().selection_text() : palette().inactive_selection_text();
|
||||
else
|
||||
text_color = model()->data(index, Model::Role::ForegroundColor).to_color(palette().color(foreground_role()));
|
||||
auto text_rect = row_rect;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue