mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 15:40:19 +00:00
LibGUI: Make TableView ignore custom colors for selected rows
This allows them to look selected instead.
This commit is contained in:
parent
97de93eed1
commit
235ae80e5e
Notes:
sideshowbarker
2024-07-19 07:41:04 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/235ae80e5e9
1 changed files with 4 additions and 4 deletions
|
@ -130,10 +130,10 @@ void TableView::paint_event(PaintEvent& event)
|
|||
text_color = is_focused() ? palette().selection_text() : palette().inactive_selection_text();
|
||||
else
|
||||
text_color = model()->data(cell_index, Model::Role::ForegroundColor).to_color(palette().color(foreground_role()));
|
||||
auto cell_background_color = model()->data(cell_index, Model::Role::BackgroundColor);
|
||||
if (cell_background_color.is_valid()) {
|
||||
// FIXME: If all cells on a row provide a color, we should really fill the whole row!
|
||||
painter.fill_rect(cell_rect_for_fill, cell_background_color.to_color(background_color));
|
||||
if (!is_selected_row) {
|
||||
auto cell_background_color = model()->data(cell_index, Model::Role::BackgroundColor);
|
||||
if (cell_background_color.is_valid())
|
||||
painter.fill_rect(cell_rect_for_fill, cell_background_color.to_color(background_color));
|
||||
}
|
||||
painter.draw_text(cell_rect, data.to_string(), font, column_metadata.text_alignment, text_color, Gfx::TextElision::Right);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue