summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón <hector0193@gmail.com>2022-01-03 16:23:01 +0700
committerLibravatar GitHub <noreply@github.com>2022-01-03 16:23:01 +0700
commit7ab584ce96dcce3d70928bd3cb07eebe87b56481 (patch)
tree12a6a841f773926c2e5e1ea6ad5277351cdfc609 /src
parent4db0f4a570a1fb3398062c78770c542d9efb8a64 (diff)
parentecd0997576378caab549cfe537639355e4a75376 (diff)
downloadiced-7ab584ce96dcce3d70928bd3cb07eebe87b56481.tar.gz
iced-7ab584ce96dcce3d70928bd3cb07eebe87b56481.tar.bz2
iced-7ab584ce96dcce3d70928bd3cb07eebe87b56481.zip
Merge pull request #1175 from EkardNT/sandbox-exit
Allow Sandbox applications to exit.
Diffstat (limited to '')
-rw-r--r--src/sandbox.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/sandbox.rs b/src/sandbox.rs
index 1b23196f..aabfb9c7 100644
--- a/src/sandbox.rs
+++ b/src/sandbox.rs
@@ -131,6 +131,13 @@ pub trait Sandbox {
1.0
}
+ /// Returns whether the [`Sandbox`] should be terminated.
+ ///
+ /// By default, it returns `false`.
+ fn should_exit(&self) -> bool {
+ false
+ }
+
/// Runs the [`Sandbox`].
///
/// On native platforms, this method will take control of the current thread
@@ -182,4 +189,8 @@ where
fn scale_factor(&self) -> f64 {
T::scale_factor(self)
}
+
+ fn should_exit(&self) -> bool {
+ T::should_exit(self)
+ }
}