Refactor cell marking, add undo, update keybindings

CellWidget::set_selected and set_marked now return &mut Self for method
chaining. Added BoardState::undo_marked_cell to remove the last marked
cell and restore focus. Backspace triggers undo, Delete clears marking.
This commit is contained in:
2026-04-13 16:57:44 +02:00
parent d5f4d03264
commit 1393f282e8
6 changed files with 74 additions and 34 deletions
@@ -49,4 +49,9 @@ impl FocusedCell {
(self.row, self.col)
}
pub fn set_focused_cell(&mut self, cell: (usize, usize)) {
self.row = cell.0.max(0).min(self.max_row - 1);
self.col = cell.1.max(0).min(self.max_col - 1);
}
}