WIP: save unverified diagram Delete candidate at user pause
This commit is contained in:
@@ -343,8 +343,8 @@ pub fn view(app: &App) -> View<'_, Message> {
|
||||
.into(),
|
||||
);
|
||||
}
|
||||
if app.delete_pending {
|
||||
return modal(root,column![text("Delete from model?").size(21),text(format!("{} and its owned elements will be removed. Incident relationships, occurrences and view placements are updated together. Counterparts in the other layer remain.",p.named(app.selected))).size(13),label("Undo restores the complete change. Use Hide for diagram-only removal."),row![action("Cancel",Message::CancelDelete),button("Delete from model").style(button::danger).padding(10).on_press(Message::ConfirmDelete)].spacing(10)].spacing(16).into());
|
||||
if let Some(target) = app.delete_target.as_ref().filter(|_| app.delete_pending) {
|
||||
return modal(root,column![text("Delete from model?").size(21),text(format!("{} and its owned elements will be removed. Incident relationships, occurrences and view placements are updated together. Counterparts in the other layer remain.",p.named(target.snapshot.request.object))).size(13),label("Undo restores the complete change. Use Hide for diagram-only removal."),row![action("Cancel",Message::CancelDelete),button("Delete from model").style(button::danger).padding(10).on_press(Message::ConfirmDelete(target.snapshot.token))].spacing(10)].spacing(16).into());
|
||||
}
|
||||
if app.pending.is_some() {
|
||||
return modal(root,column![text("Keep your changes?").size(21),text("Save the model and pending edits before continuing. Invalid drafts stay available for correction.").size(13),row![action("Cancel",Message::Cancel),action("Discard changes",Message::Discard),button("Save & continue").padding(10).on_press(Message::SaveAndContinue)].spacing(8)].spacing(16).into());
|
||||
@@ -459,7 +459,12 @@ fn diagram(app: &App) -> View<'_, Message> {
|
||||
connection: app.connection.as_ref(),
|
||||
};
|
||||
let mut scene = widget::stack![
|
||||
widget::canvas(program).width(Fill).height(Fill),
|
||||
crate::diagram::focus::wrap(
|
||||
widget::canvas(program).width(Fill).height(Fill),
|
||||
program.context,
|
||||
crate::app::diagram_removal::enabled(app),
|
||||
Message::DiagramTraverse
|
||||
),
|
||||
widget::canvas(crate::diagram::PortLabels(program))
|
||||
.width(Fill)
|
||||
.height(Fill),
|
||||
|
||||
Reference in New Issue
Block a user