summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibGUI/IconView.h
diff options
context:
space:
mode:
authorTom <tomut@yahoo.com>2021-02-15 19:30:47 -0700
committerAndreas Kling <kling@serenityos.org>2021-02-25 18:04:06 +0100
commit6cdb6574935a1f576542ddb3c4a4e73650f1b54a (patch)
treef67279629ee25dd1497489d13298f9ec31f24590 /Userland/Libraries/LibGUI/IconView.h
parentcd0a1fa5b0d5b0dd245d384caecbc2500d9bdab7 (diff)
downloadserenity-6cdb6574935a1f576542ddb3c4a4e73650f1b54a.zip
LibGUI: Improve IconView rubberband performance
Rather than invalidating the entire window, which is very expensive on the transparent desktop widget, just invalidate the areas that actually need updating.
Diffstat (limited to 'Userland/Libraries/LibGUI/IconView.h')
-rw-r--r--Userland/Libraries/LibGUI/IconView.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/Userland/Libraries/LibGUI/IconView.h b/Userland/Libraries/LibGUI/IconView.h
index 71cf41b8ed..ecc895f645 100644
--- a/Userland/Libraries/LibGUI/IconView.h
+++ b/Userland/Libraries/LibGUI/IconView.h
@@ -109,6 +109,11 @@ private:
VERIFY(valid);
return icon_rect.contains(point) || text_rect.contains(point);
}
+
+ Gfx::IntRect rect() const
+ {
+ return text_rect.united(icon_rect);
+ }
};
template<typename Function>