mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 06:58:11 +00:00
LibGUI: Allow falling back to default paint behavior in delegate
This patch adds a method that can optionally be implemented to allow a TableCellPaintingDelegate to fall back to the default painting in a View.
This commit is contained in:
parent
e2df145e14
commit
b67d4ab52f
3 changed files with 6 additions and 2 deletions
|
@ -98,7 +98,8 @@ void TableView::paint_event(PaintEvent& event)
|
|||
painter.fill_rect(cell_rect_for_fill, key_column_background_color);
|
||||
auto cell_index = model()->index(row_index, column_index);
|
||||
|
||||
if (auto* delegate = column_painting_delegate(column_index)) {
|
||||
auto* delegate = column_painting_delegate(column_index);
|
||||
if (delegate && delegate->should_paint(cell_index)) {
|
||||
delegate->paint(painter, cell_rect, palette(), cell_index);
|
||||
} else {
|
||||
auto data = cell_index.data();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue