Box captured removal selection for compact review events
This commit is contained in:
@@ -13,7 +13,7 @@ pub(crate) mod view;
|
|||||||
pub(crate) enum Event {
|
pub(crate) enum Event {
|
||||||
Begin {
|
Begin {
|
||||||
context: scenario::Context,
|
context: scenario::Context,
|
||||||
snapshot: Snapshot,
|
snapshot: Box<Snapshot>,
|
||||||
},
|
},
|
||||||
Query {
|
Query {
|
||||||
token: u64,
|
token: u64,
|
||||||
@@ -41,7 +41,7 @@ pub(crate) fn begin(app: &App) -> Option<Message> {
|
|||||||
let snapshot = app.multiselect_snapshot()?;
|
let snapshot = app.multiselect_snapshot()?;
|
||||||
(snapshot.targets().len() > 1).then_some(Message::ScenarioRemoval(Box::new(Event::Begin {
|
(snapshot.targets().len() > 1).then_some(Message::ScenarioRemoval(Box::new(Event::Begin {
|
||||||
context,
|
context,
|
||||||
snapshot,
|
snapshot: Box::new(snapshot),
|
||||||
})))
|
})))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -114,7 +114,7 @@ fn send(app: &mut App, event: Event) {
|
|||||||
fn captured(app: &App) -> Event {
|
fn captured(app: &App) -> Event {
|
||||||
Event::Begin {
|
Event::Begin {
|
||||||
context: app.scenario_context().unwrap(),
|
context: app.scenario_context().unwrap(),
|
||||||
snapshot: app.multiselect_snapshot().unwrap(),
|
snapshot: Box::new(app.multiselect_snapshot().unwrap()),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
fn open(app: &mut App) -> u64 {
|
fn open(app: &mut App) -> u64 {
|
||||||
|
|||||||
@@ -2154,7 +2154,7 @@ impl canvas::Program<Message> for Scene {
|
|||||||
Action::publish(Message::ScenarioRemoval(Box::new(
|
Action::publish(Message::ScenarioRemoval(Box::new(
|
||||||
crate::app::scenario_removal::Event::Begin {
|
crate::app::scenario_removal::Event::Begin {
|
||||||
context,
|
context,
|
||||||
snapshot: snapshot.clone(),
|
snapshot: Box::new(snapshot.clone()),
|
||||||
},
|
},
|
||||||
)))
|
)))
|
||||||
.and_capture(),
|
.and_capture(),
|
||||||
|
|||||||
@@ -229,7 +229,7 @@ fn scenario_group_menus_capture_set_and_never_expose_partial_model_actions() {
|
|||||||
};
|
};
|
||||||
assert_eq!(label, "Remove selected from Scenario…");
|
assert_eq!(label, "Remove selected from Scenario…");
|
||||||
assert_eq!(Some(*context), app.scenario_context());
|
assert_eq!(Some(*context), app.scenario_context());
|
||||||
assert_eq!(captured, &snapshot);
|
assert_eq!(captured.as_ref(), &snapshot);
|
||||||
removals += 1;
|
removals += 1;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user