From 10bbb01ed86b3dea540c63c28e5e9ce9b1cdecd7 Mon Sep 17 00:00:00 2001 From: martinfalisse Date: Tue, 8 Feb 2022 11:43:39 +0100 Subject: [PATCH] Spreadsheet: Set cursor manually so that correct cells are outlined Due to the fact that in the AbstractView, when multiple cells are selected, and then another cell is selected within this selection, the cursor is not updated as the user may be beginning to drag, have to override this functionality for the Spreadsheet application. This is because in spreadsheets when multiple cells are selected, and then you click on one of the cells within the selection, the selection should be cleared and the targetted cell highlighted. --- Userland/Applications/Spreadsheet/SpreadsheetView.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Userland/Applications/Spreadsheet/SpreadsheetView.cpp b/Userland/Applications/Spreadsheet/SpreadsheetView.cpp index 4029886779..b8b1536243 100644 --- a/Userland/Applications/Spreadsheet/SpreadsheetView.cpp +++ b/Userland/Applications/Spreadsheet/SpreadsheetView.cpp @@ -182,6 +182,8 @@ void InfinitelyScrollableTableView::mousedown_event(GUI::MouseEvent& event) AbstractTableView::mousedown_event(adjusted_event); } else { AbstractTableView::mousedown_event(event); + auto index = index_at_event_position(event.position()); + AbstractTableView::set_cursor(index, SelectionUpdate::Set); } }