mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-03 15:16:14 +00:00
LibGUI: Improve and simplify IconView item name wrapping
Move the wrapping logic to get_item_rects(). This makes mouse events able to hit the wrapped labels, and various other little things stop glitching out as well. Also, instead of having a per-line width when wrapping icon names, make the text rect wide enough to fit every line.
This commit is contained in:
@@ -242,7 +242,9 @@ void AbstractView::set_hovered_index(const ModelIndex& index)
|
||||
{
|
||||
if (m_hovered_index == index)
|
||||
return;
|
||||
auto old_index = m_hovered_index;
|
||||
m_hovered_index = index;
|
||||
did_change_hovered_index(old_index, index);
|
||||
update();
|
||||
}
|
||||
|
||||
@@ -445,7 +447,9 @@ void AbstractView::set_cursor(ModelIndex index, SelectionUpdate selection_update
|
||||
|
||||
// FIXME: Support the other SelectionUpdate types
|
||||
|
||||
auto old_cursor_index = m_cursor_index;
|
||||
m_cursor_index = index;
|
||||
did_change_cursor_index(old_cursor_index, m_cursor_index);
|
||||
|
||||
if (scroll_cursor_into_view)
|
||||
scroll_into_view(index, true, true);
|
||||
|
||||
Reference in New Issue
Block a user