Preserve diagram focus across edits, history and passive saves
This commit is contained in:
@@ -10,8 +10,12 @@ pub use control::Control;
|
||||
pub use viewport::Viewport;
|
||||
|
||||
pub fn keyboard_enabled(app: &crate::app::App) -> bool {
|
||||
!app.busy
|
||||
&& !app.hosted.visible
|
||||
!app.busy && keyboard_owner_enabled(app)
|
||||
}
|
||||
|
||||
/// Passive I/O suspends commands without changing the logical input owner.
|
||||
pub(crate) fn keyboard_owner_enabled(app: &crate::app::App) -> bool {
|
||||
!app.hosted.visible
|
||||
&& app.workflow.is_none()
|
||||
&& app.file_prompt.is_none()
|
||||
&& !app.delete_pending
|
||||
|
||||
@@ -176,7 +176,8 @@ pub fn view<'a>(app: &'a App, machine: Id, mut out: Column<'a, Message>) -> Elem
|
||||
out = out.push(crate::diagram::focus::wrap(
|
||||
canvas.map(event),
|
||||
context,
|
||||
crate::app::diagram_removal::enabled(app),
|
||||
crate::app::diagram_removal::focus_enabled(app),
|
||||
app.busy,
|
||||
Message::DiagramTraverse,
|
||||
));
|
||||
let base: Element<'_, Message> = container(out.spacing(8))
|
||||
|
||||
Reference in New Issue
Block a user