diff options
author | thankyouverycool <66646555+thankyouverycool@users.noreply.github.com> | 2021-03-29 22:29:02 -0400 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-03-30 10:33:08 +0200 |
commit | fec9c8034d9d2347f20ea807cfc8538df9364ef7 (patch) | |
tree | 3978393d8f34dd0d401d0441a08e8ee49ac6a1d9 /Userland/Libraries/LibGUI | |
parent | 855920fe136efe27c758a13ba8231690cd7052b8 (diff) | |
download | serenity-fec9c8034d9d2347f20ea807cfc8538df9364ef7.zip |
LibGUI: Don't inflate icon text rects beyond available width
Fixes wrapped text candidates not first eliding
Diffstat (limited to 'Userland/Libraries/LibGUI')
-rw-r--r-- | Userland/Libraries/LibGUI/IconView.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Userland/Libraries/LibGUI/IconView.cpp b/Userland/Libraries/LibGUI/IconView.cpp index 7d1a840dc3..2e1530a279 100644 --- a/Userland/Libraries/LibGUI/IconView.cpp +++ b/Userland/Libraries/LibGUI/IconView.cpp @@ -480,6 +480,8 @@ void IconView::get_item_rects(int item_index, ItemData& item_data, const Gfx::Fo } else { item_data.text_rect.set_width(unwrapped_text_width); item_data.text_rect.inflate(6, 4); + if (item_data.text_rect.width() > available_width) + item_data.text_rect.set_width(available_width); item_data.text_rect.center_horizontally_within(item_rect); } item_data.text_rect.intersect(item_rect); |