generated from GarandPLG/rust-flake-template
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:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user