LibGUI: Don't scroll TreeView horizontally to bring index into view

This behavior was really irritating and basically never what you wanted
so let's stop doing it.
This commit is contained in:
Andreas Kling 2021-05-30 09:28:19 +02:00
parent 42b27d9f87
commit 460c0f9847
Notes: sideshowbarker 2024-07-18 17:11:11 +09:00

View file

@ -370,7 +370,7 @@ void TreeView::paint_event(PaintEvent& event)
});
}
void TreeView::scroll_into_view(const ModelIndex& a_index, bool scroll_horizontally, bool scroll_vertically)
void TreeView::scroll_into_view(const ModelIndex& a_index, bool, bool scroll_vertically)
{
if (!a_index.is_valid())
return;
@ -382,7 +382,7 @@ void TreeView::scroll_into_view(const ModelIndex& a_index, bool scroll_horizonta
}
return IterationDecision::Continue;
});
AbstractScrollableWidget::scroll_into_view(found_rect, scroll_horizontally, scroll_vertically);
AbstractScrollableWidget::scroll_into_view(found_rect, false, scroll_vertically);
}
void TreeView::model_did_update(unsigned flags)