h and l movements are now working
This commit is contained in:
@@ -138,6 +138,66 @@ pub fn handle_add_logic_navigation(
|
||||
AddLogicFocus::InputDescription | AddLogicFocus::InputScriptContent);
|
||||
handled = true;
|
||||
}
|
||||
Some("next_option") => { // Horizontal next
|
||||
let previous_focus = add_logic_state.current_focus;
|
||||
add_logic_state.current_focus = match add_logic_state.current_focus {
|
||||
AddLogicFocus::InputLogicName => AddLogicFocus::InputTargetColumn,
|
||||
AddLogicFocus::InputTargetColumn => AddLogicFocus::InputDescription,
|
||||
AddLogicFocus::InputDescription => AddLogicFocus::InputScriptContent,
|
||||
AddLogicFocus::InputScriptContent => AddLogicFocus::SaveButton,
|
||||
AddLogicFocus::SaveButton => AddLogicFocus::CancelButton,
|
||||
AddLogicFocus::CancelButton => AddLogicFocus::InputLogicName, // Cycle back
|
||||
};
|
||||
// Update canvas field index if moving within canvas inputs
|
||||
if matches!(add_logic_state.current_focus, AddLogicFocus::InputLogicName | AddLogicFocus::InputTargetColumn | AddLogicFocus::InputDescription) {
|
||||
let new_field = match add_logic_state.current_focus {
|
||||
AddLogicFocus::InputLogicName => 0,
|
||||
AddLogicFocus::InputTargetColumn => 1,
|
||||
AddLogicFocus::InputDescription => 2,
|
||||
_ => add_logic_state.current_field(), // Should not happen
|
||||
};
|
||||
add_logic_state.set_current_field(new_field);
|
||||
}
|
||||
app_state.ui.focus_outside_canvas = !matches!(
|
||||
add_logic_state.current_focus,
|
||||
AddLogicFocus::InputLogicName | AddLogicFocus::InputTargetColumn | AddLogicFocus::InputDescription
|
||||
);
|
||||
*command_message = format!("Focus: {:?}", add_logic_state.current_focus);
|
||||
*is_edit_mode = matches!(add_logic_state.current_focus,
|
||||
AddLogicFocus::InputLogicName | AddLogicFocus::InputTargetColumn |
|
||||
AddLogicFocus::InputDescription | AddLogicFocus::InputScriptContent);
|
||||
handled = true;
|
||||
}
|
||||
Some("previous_option") => { // Horizontal previous
|
||||
let previous_focus = add_logic_state.current_focus;
|
||||
add_logic_state.current_focus = match add_logic_state.current_focus {
|
||||
AddLogicFocus::InputLogicName => AddLogicFocus::CancelButton, // Cycle back
|
||||
AddLogicFocus::InputTargetColumn => AddLogicFocus::InputLogicName,
|
||||
AddLogicFocus::InputDescription => AddLogicFocus::InputTargetColumn,
|
||||
AddLogicFocus::InputScriptContent => AddLogicFocus::InputDescription,
|
||||
AddLogicFocus::SaveButton => AddLogicFocus::InputScriptContent,
|
||||
AddLogicFocus::CancelButton => AddLogicFocus::SaveButton,
|
||||
};
|
||||
// Update canvas field index if moving within canvas inputs
|
||||
if matches!(add_logic_state.current_focus, AddLogicFocus::InputLogicName | AddLogicFocus::InputTargetColumn | AddLogicFocus::InputDescription) {
|
||||
let new_field = match add_logic_state.current_focus {
|
||||
AddLogicFocus::InputLogicName => 0,
|
||||
AddLogicFocus::InputTargetColumn => 1,
|
||||
AddLogicFocus::InputDescription => 2,
|
||||
_ => add_logic_state.current_field(), // Should not happen
|
||||
};
|
||||
add_logic_state.set_current_field(new_field);
|
||||
}
|
||||
app_state.ui.focus_outside_canvas = !matches!(
|
||||
add_logic_state.current_focus,
|
||||
AddLogicFocus::InputLogicName | AddLogicFocus::InputTargetColumn | AddLogicFocus::InputDescription
|
||||
);
|
||||
*command_message = format!("Focus: {:?}", add_logic_state.current_focus);
|
||||
*is_edit_mode = matches!(add_logic_state.current_focus,
|
||||
AddLogicFocus::InputLogicName | AddLogicFocus::InputTargetColumn |
|
||||
AddLogicFocus::InputDescription | AddLogicFocus::InputScriptContent);
|
||||
handled = true;
|
||||
}
|
||||
Some("select") => {
|
||||
match add_logic_state.current_focus {
|
||||
AddLogicFocus::SaveButton => {
|
||||
|
||||
Reference in New Issue
Block a user