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