summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibGUI
diff options
context:
space:
mode:
authorthankyouverycool <66646555+thankyouverycool@users.noreply.github.com>2021-03-29 22:29:02 -0400
committerAndreas Kling <kling@serenityos.org>2021-03-30 10:33:08 +0200
commitfec9c8034d9d2347f20ea807cfc8538df9364ef7 (patch)
tree3978393d8f34dd0d401d0441a08e8ee49ac6a1d9 /Userland/Libraries/LibGUI
parent855920fe136efe27c758a13ba8231690cd7052b8 (diff)
downloadserenity-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.cpp2
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);