moving the state from general to each page owning its own state of button or canvas focus
This commit is contained in:
@@ -40,14 +40,11 @@ impl ModeManager {
|
||||
// If focus is inside a canvas, we don't duplicate canvas modes here.
|
||||
// Canvas crate owns ReadOnly/Edit/Highlight internally.
|
||||
match &router.current {
|
||||
Page::Form(_)
|
||||
| Page::Login(_)
|
||||
| Page::Register(_)
|
||||
| Page::AddTable(_)
|
||||
| Page::AddLogic(_) if !app_state.ui.focus_outside_canvas => {
|
||||
// Canvas active → let canvas handle its own AppMode
|
||||
AppMode::General
|
||||
}
|
||||
Page::Form(_) => AppMode::General, // Form always has its own canvas
|
||||
Page::Login(state) if !state.focus_outside_canvas => AppMode::General,
|
||||
Page::Register(state) if !state.focus_outside_canvas => AppMode::General,
|
||||
Page::AddTable(state) if !state.focus_outside_canvas => AppMode::General,
|
||||
Page::AddLogic(state) if !state.focus_outside_canvas => AppMode::General,
|
||||
_ => AppMode::General,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user