moving the state from general to each page owning its own state of button or canvas focus
This commit is contained in:
@@ -26,7 +26,6 @@ pub fn handle_login_event(
|
||||
&& modifiers.is_empty()
|
||||
{
|
||||
login_page.focus_outside_canvas = false;
|
||||
app_state.ui.focus_outside_canvas = false; // 🔑 keep global in sync
|
||||
login_page.editor.set_mode(CanvasMode::ReadOnly);
|
||||
return Ok(EventOutcome::Ok(String::new()));
|
||||
}
|
||||
@@ -43,9 +42,7 @@ pub fn handle_login_event(
|
||||
)
|
||||
{
|
||||
login_page.focus_outside_canvas = true;
|
||||
login_page.focused_button_index = 0; // focus "Login" button
|
||||
app_state.ui.focus_outside_canvas = true;
|
||||
app_state.focused_button_index = 0;
|
||||
login_page.focused_button_index = 0;
|
||||
login_page.editor.set_mode(CanvasMode::ReadOnly);
|
||||
return Ok(EventOutcome::Ok("Focus moved to buttons".into()));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user