mirror of
https://github.com/slint-ui/slint.git
synced 2025-08-04 18:58:36 +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
|
@ -363,7 +363,7 @@ fn generate_shared_globals(
|
|||
let apply_constant_scale_factor = if !compiler_config.const_scale_factor.approx_eq(&1.0) {
|
||||
let factor = compiler_config.const_scale_factor as f32;
|
||||
Some(
|
||||
quote!(adapter.window().dispatch_event(slint::platform::WindowEvent::ScaleFactorChanged{ scale_factor: #factor });),
|
||||
quote!(adapter.window().try_dispatch_event(slint::platform::WindowEvent::ScaleFactorChanged{ scale_factor: #factor })?;),
|
||||
)
|
||||
} else {
|
||||
None
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue