LibGUI: Make IconView return a larger content rect for editing

This fixes a visual glitch where editing the name of an item in an
IconView would cut off the edited text.
This commit is contained in:
Andreas Kling 2020-12-27 19:05:43 +01:00
commit f294bdedcc
Notes: sideshowbarker 2024-07-19 00:33:23 +09:00

View file

@ -417,7 +417,7 @@ Gfx::IntRect IconView::content_rect(const ModelIndex& index) const
if (!index.is_valid())
return {};
auto& item_data = get_item_data(index.row());
return item_data.text_rect;
return item_data.text_rect.inflated(4, 4);
}
void IconView::did_change_hovered_index(const ModelIndex& old_index, const ModelIndex& new_index)