mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-03 15:16:14 +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:
committed by
Andreas Kling
parent
e2df145e14
commit
b67d4ab52f
@@ -291,7 +291,8 @@ void TreeView::paint_event(PaintEvent& event)
|
||||
Gfx::IntRect cell_rect(horizontal_padding() + x_offset, rect.y(), column_width, row_height());
|
||||
auto cell_index = model.index(index.row(), column_index, index.parent());
|
||||
|
||||
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();
|
||||
|
||||
Reference in New Issue
Block a user