X buttons in popup menus werent clickable, fix by unconsuming the event

This commit is contained in:
Dustin Carlino 2020-02-11 16:25:44 -08:00
parent b033c4f720
commit 67846ee2ca
2 changed files with 6 additions and 0 deletions

View File

@ -167,6 +167,10 @@ impl UserInput {
assert!(!self.event_consumed);
self.event_consumed = true;
}
pub(crate) fn unconsume_event(&mut self) {
assert!(self.event_consumed);
self.event_consumed = false;
}
// Just for Wizard
pub(crate) fn has_been_consumed(&self) -> bool {

View File

@ -74,6 +74,8 @@ impl<T: Clone> PopupMenu<T> {
self.state = InputResult::Done(choice.label.clone(), choice.data.clone());
return;
}
// Unconsume the click, it was in screen space, but not on us.
ctx.input.unconsume_event();
} else {
// Clicked on the map? Cancel out
self.state = InputResult::Canceled;