mirror of
https://github.com/slint-ui/slint.git
synced 2025-11-17 02:43:04 +00:00
Introduce Window::try_dispatch_event (#7313)
That is the same as Window::dispatch_event, but it reports an error instead of panicking
This commit is contained in:
parent
19bfe926d2
commit
cfbcf0b1d7
15 changed files with 137 additions and 102 deletions
|
|
@ -154,11 +154,11 @@ impl slint::platform::Platform for EspBackend {
|
|||
let is_pointer_release_event =
|
||||
matches!(event, WindowEvent::PointerReleased { .. });
|
||||
|
||||
window.dispatch_event(event);
|
||||
window.try_dispatch_event(event)?;
|
||||
|
||||
// removes hover state on widgets
|
||||
if is_pointer_release_event {
|
||||
window.dispatch_event(WindowEvent::PointerExited);
|
||||
window.try_dispatch_event(WindowEvent::PointerExited)?;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue