From d27a8e505f0b8374b2edfc0271687cd4fa4f4490 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Wed, 28 Oct 2020 21:41:51 +0100 Subject: [PATCH] LibGUI: IconView was hard-coding column 0 instead of model_column() Some of the indexes generated during cursor movement were using column instead of model_column(), which caused inconsistent display of items under the cursor. --- Libraries/LibGUI/IconView.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Libraries/LibGUI/IconView.cpp b/Libraries/LibGUI/IconView.cpp index 41f7803536..d1f90f614d 100644 --- a/Libraries/LibGUI/IconView.cpp +++ b/Libraries/LibGUI/IconView.cpp @@ -684,7 +684,7 @@ void IconView::move_cursor(CursorMovement movement, SelectionUpdate selection_up auto& model = *this->model(); if (!cursor_index().is_valid()) { - set_cursor(model.index(0, 0), SelectionUpdate::Set); + set_cursor(model.index(0, model_column()), SelectionUpdate::Set); return; } @@ -714,10 +714,10 @@ void IconView::move_cursor(CursorMovement movement, SelectionUpdate selection_up break; } case CursorMovement::Home: - new_index = model.index(0, 0); + new_index = model.index(0, model_column()); break; case CursorMovement::End: - new_index = model.index(model.row_count() - 1, 0); + new_index = model.index(model.row_count() - 1, model_column()); break; default: break;