mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 04:27:45 +00:00
Spreadsheet: Make undo operation handle multiple cells at a time
Instead of having the undo operation only be able to undo one cell for a given undo, make it able to handle multiple cells at a time. Please enter the commit message for your changes. Lines starting
This commit is contained in:
parent
7bd0ebb1ab
commit
22575c9370
7 changed files with 59 additions and 31 deletions
|
@ -281,7 +281,7 @@ void SpreadsheetWidget::setup_tabs(NonnullRefPtrVector<Sheet> new_sheets)
|
|||
for (auto& sheet : new_sheets) {
|
||||
auto& new_view = m_tab_widget->add_tab<SpreadsheetView>(sheet.name(), sheet);
|
||||
new_view.model()->on_cell_data_change = [&](auto& cell, auto& previous_data) {
|
||||
undo_stack().push(make<CellUndoCommand>(cell, previous_data));
|
||||
undo_stack().push(make<CellsUndoCommand>(cell, previous_data));
|
||||
window()->set_modified(true);
|
||||
};
|
||||
new_view.on_selection_changed = [&](Vector<Position>&& selection) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue