mirror of
https://github.com/slint-ui/slint.git
synced 2025-08-31 07:37:24 +00:00
Introduce error handling in the FemtoVG and Skia renderers (#2402)
Avoid unwrap() and expect() and instead propagate errors all the way down to run_event_loop(), show(), and hide() in the Slint AIP.
This commit is contained in:
parent
7f95614a98
commit
8ffb5131c7
28 changed files with 627 additions and 357 deletions
|
@ -1045,17 +1045,16 @@ impl ComponentHandle for ComponentInstance {
|
|||
comp.borrow_instance().window_adapter().window().show()
|
||||
}
|
||||
|
||||
fn hide(&self) {
|
||||
fn hide(&self) -> Result<(), PlatformError> {
|
||||
generativity::make_guard!(guard);
|
||||
let comp = self.inner.unerase(guard);
|
||||
comp.borrow_instance().window_adapter().window().hide();
|
||||
comp.borrow_instance().window_adapter().window().hide()
|
||||
}
|
||||
|
||||
fn run(&self) -> Result<(), PlatformError> {
|
||||
self.show()?;
|
||||
run_event_loop()?;
|
||||
self.hide();
|
||||
Ok(())
|
||||
self.hide()
|
||||
}
|
||||
|
||||
fn window(&self) -> &Window {
|
||||
|
|
|
@ -562,7 +562,7 @@ pub extern "C" fn slint_interpreter_component_instance_show(
|
|||
if is_visible {
|
||||
comp.borrow_instance().window_adapter().show().unwrap();
|
||||
} else {
|
||||
comp.borrow_instance().window_adapter().hide();
|
||||
comp.borrow_instance().window_adapter().hide().unwrap();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue