mirror of
https://github.com/RGBCube/serenity
synced 2025-07-22 10:57:34 +00:00
LibGUI: Don't inflate icon text rects beyond available width
Fixes wrapped text candidates not first eliding
This commit is contained in:
parent
855920fe13
commit
fec9c8034d
1 changed files with 2 additions and 0 deletions
|
@ -480,6 +480,8 @@ void IconView::get_item_rects(int item_index, ItemData& item_data, const Gfx::Fo
|
||||||
} else {
|
} else {
|
||||||
item_data.text_rect.set_width(unwrapped_text_width);
|
item_data.text_rect.set_width(unwrapped_text_width);
|
||||||
item_data.text_rect.inflate(6, 4);
|
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.center_horizontally_within(item_rect);
|
||||||
}
|
}
|
||||||
item_data.text_rect.intersect(item_rect);
|
item_data.text_rect.intersect(item_rect);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue