mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 12:48:10 +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
|
@ -388,7 +388,15 @@ void IconView::update_item_rects(int item_index, ItemData& item_data) const
|
|||
item_data.text_rect.set_top(item_rect.y() + item_data.text_offset_y);
|
||||
}
|
||||
|
||||
Gfx::IntRect IconView::content_rect(const ModelIndex& index) const
|
||||
Gfx::IntRect IconView::content_rect(ModelIndex const& index) const
|
||||
{
|
||||
if (!index.is_valid())
|
||||
return {};
|
||||
auto& item_data = get_item_data(index.row());
|
||||
return item_data.rect();
|
||||
}
|
||||
|
||||
Gfx::IntRect IconView::editing_rect(ModelIndex const& index) const
|
||||
{
|
||||
if (!index.is_valid())
|
||||
return {};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue