瀏覽代碼

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.
martinfalisse 3 年之前
父節點
當前提交
10bbb01ed8
共有 1 個文件被更改,包括 2 次插入0 次删除
  1. 2 0
      Userland/Applications/Spreadsheet/SpreadsheetView.cpp

+ 2 - 0
Userland/Applications/Spreadsheet/SpreadsheetView.cpp

@@ -182,6 +182,8 @@ void InfinitelyScrollableTableView::mousedown_event(GUI::MouseEvent& event)
         AbstractTableView::mousedown_event(adjusted_event);
         AbstractTableView::mousedown_event(adjusted_event);
     } else {
     } else {
         AbstractTableView::mousedown_event(event);
         AbstractTableView::mousedown_event(event);
+        auto index = index_at_event_position(event.position());
+        AbstractTableView::set_cursor(index, SelectionUpdate::Set);
     }
     }
 }
 }