refactor(BlockSelectionState): Refactored so selection of blocks in 2x2 grids is more intuitive and added left() and right() methods to aid this effort.

This commit is contained in:
2024-11-30 12:22:46 -07:00
parent 9b2040059d
commit f7c96d81e9
27 changed files with 472 additions and 387 deletions
+13
View File
@@ -140,3 +140,16 @@ macro_rules! handle_text_box_keys {
}
};
}
#[macro_export]
macro_rules! handle_prompt_left_right_keys {
($self:expr, $confirm_prompt:expr, $data:ident) => {
if $self.app.data.$data.selected_block.get_active_block() == $confirm_prompt {
handle_prompt_toggle($self.app, $self.key);
} else if $self.key == DEFAULT_KEYBINDINGS.left.key {
$self.app.data.$data.selected_block.left();
} else {
$self.app.data.$data.selected_block.right();
}
};
}