mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 15:57:45 +00:00
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.
This commit is contained in:
parent
de3dc15a6e
commit
d27a8e505f
1 changed files with 3 additions and 3 deletions
|
@ -684,7 +684,7 @@ void IconView::move_cursor(CursorMovement movement, SelectionUpdate selection_up
|
||||||
auto& model = *this->model();
|
auto& model = *this->model();
|
||||||
|
|
||||||
if (!cursor_index().is_valid()) {
|
if (!cursor_index().is_valid()) {
|
||||||
set_cursor(model.index(0, 0), SelectionUpdate::Set);
|
set_cursor(model.index(0, model_column()), SelectionUpdate::Set);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -714,10 +714,10 @@ void IconView::move_cursor(CursorMovement movement, SelectionUpdate selection_up
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case CursorMovement::Home:
|
case CursorMovement::Home:
|
||||||
new_index = model.index(0, 0);
|
new_index = model.index(0, model_column());
|
||||||
break;
|
break;
|
||||||
case CursorMovement::End:
|
case CursorMovement::End:
|
||||||
new_index = model.index(model.row_count() - 1, 0);
|
new_index = model.index(model.row_count() - 1, model_column());
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue