Avoid PaneGrid
unfocus when cursor is unavailable
This commit is contained in:
parent
a225a218e0
commit
a165eddd75
@ -496,7 +496,10 @@ where
|
||||
}
|
||||
}
|
||||
} else {
|
||||
self.state.unfocus();
|
||||
// TODO: Encode cursor availability in the type system
|
||||
if cursor_position.x > 0.0 && cursor_position.y > 0.0 {
|
||||
self.state.unfocus();
|
||||
}
|
||||
}
|
||||
}
|
||||
mouse::Event::ButtonReleased(mouse::Button::Left) => {
|
||||
|
@ -227,6 +227,7 @@ where
|
||||
match event {
|
||||
Event::Mouse(mouse::Event::ButtonPressed(mouse::Button::Left)) => {
|
||||
if *self.is_open {
|
||||
// TODO: Encode cursor availability in the type system
|
||||
*self.is_open =
|
||||
cursor_position.x < 0.0 || cursor_position.y < 0.0;
|
||||
} else if layout.bounds().contains(cursor_position) {
|
||||
|
Loading…
Reference in New Issue
Block a user