From 460c0f984796605a55e6e172d34201c9bbaee0d2 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sun, 30 May 2021 09:28:19 +0200 Subject: [PATCH] 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. --- Userland/Libraries/LibGUI/TreeView.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Userland/Libraries/LibGUI/TreeView.cpp b/Userland/Libraries/LibGUI/TreeView.cpp index 5cb541464a..cdf6031680 100644 --- a/Userland/Libraries/LibGUI/TreeView.cpp +++ b/Userland/Libraries/LibGUI/TreeView.cpp @@ -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)