1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 03:57:43 +00:00

Spreadsheet: Allow customising the cell foreground and background colors

This commit is contained in:
AnotherTest 2020-09-12 15:33:35 +04:30 committed by Andreas Kling
parent 8fa385f774
commit c2228b669d
2 changed files with 129 additions and 61 deletions

View file

@ -171,6 +171,9 @@ void SpreadsheetView::TableCellPainter::paint(GUI::Painter& painter, const Gfx::
// Undo the horizontal padding done by the table view...
auto cell_rect = rect.inflated(m_table_view.horizontal_padding() * 2, 0);
if (auto bg = index.data(GUI::ModelRole::BackgroundColor); bg.is_color())
painter.fill_rect(cell_rect, bg.as_color());
if (m_table_view.selection().contains(index)) {
Color fill_color = palette.selection();
fill_color.set_alpha(80);