Prevent body events pane is picked / dragging

This commit is contained in:
Cory Forsstrom 2021-07-27 15:41:45 -07:00
parent 2a49e415d2
commit be65a847b0
2 changed files with 24 additions and 10 deletions

View file

@ -452,17 +452,26 @@ where
_ => {}
}
let picked_pane = self.state.picked_pane().map(|(pane, _)| pane);
self.elements
.iter_mut()
.zip(layout.children())
.map(|((_, pane), layout)| {
pane.on_event(
.map(|((pane, content), layout)| {
let is_picked = if let Some(picked_pane) = picked_pane {
picked_pane == *pane
} else {
false
};
content.on_event(
event.clone(),
layout,
cursor_position,
renderer,
clipboard,
messages,
is_picked,
)
})
.fold(event_status, event::Status::merge)