mirror of
https://github.com/a-b-street/abstreet.git
synced 2024-12-01 10:44:56 +03:00
X buttons in popup menus werent clickable, fix by unconsuming the event
This commit is contained in:
parent
b033c4f720
commit
67846ee2ca
@ -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 {
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user