mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 12:28:12 +00:00
LibGUI: Tighten paint invalidation rects in item views :^)
AbstractView now has a paint_invalidation_rect(index) function that subclasses can override to provide a tighter invalidation rect for an index.
This commit is contained in:
parent
148e72bfa0
commit
df96380121
9 changed files with 48 additions and 1 deletions
|
@ -323,4 +323,12 @@ Gfx::IntRect ColumnsView::content_rect(const ModelIndex& index) const
|
|||
return {};
|
||||
}
|
||||
|
||||
Gfx::IntRect ColumnsView::paint_invalidation_rect(ModelIndex const& index) const
|
||||
{
|
||||
auto rect = content_rect(index);
|
||||
rect.translate_by(-icon_size(), 0);
|
||||
rect.set_width(rect.width() + icon_size());
|
||||
return rect;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue