summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibGUI/ColumnsView.cpp
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2021-07-10 17:11:04 +0200
committerAndreas Kling <kling@serenityos.org>2021-07-10 18:30:46 +0200
commitdf9638012197fc3a15ad1ece7a875ed805a9bce5 (patch)
tree119b0408e56f7eefce690d04e7368114718100a4 /Userland/Libraries/LibGUI/ColumnsView.cpp
parent148e72bfa0a93e7ec5467b4dae7701f4ab9201f5 (diff)
downloadserenity-df9638012197fc3a15ad1ece7a875ed805a9bce5.zip
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.
Diffstat (limited to 'Userland/Libraries/LibGUI/ColumnsView.cpp')
-rw-r--r--Userland/Libraries/LibGUI/ColumnsView.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/Userland/Libraries/LibGUI/ColumnsView.cpp b/Userland/Libraries/LibGUI/ColumnsView.cpp
index 4262feb0a2..7e0c7e8e7d 100644
--- a/Userland/Libraries/LibGUI/ColumnsView.cpp
+++ b/Userland/Libraries/LibGUI/ColumnsView.cpp
@@ -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;
+}
+
}