diff options
author | HampusM <hampus@hampusmat.com> | 2024-05-18 17:34:13 +0200 |
---|---|---|
committer | HampusM <hampus@hampusmat.com> | 2024-05-18 17:34:13 +0200 |
commit | bcf1e9c00e3959c3db047d2d8b3ac7d6c4853796 (patch) | |
tree | 871b12ca77f0d3d30139c2b5a8830e1eb0cf837d | |
parent | 35df7a829852c1dfc51be6b02678e631ce7f4d1b (diff) |
feat(engine): add Window function to set focus callback
-rw-r--r-- | engine/src/window.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/engine/src/window.rs b/engine/src/window.rs index fde2cca..eed7901 100644 --- a/engine/src/window.rs +++ b/engine/src/window.rs @@ -169,6 +169,13 @@ impl Window { self.inner.set_close_callback(callback); } + + /// Sets the window's focus callback. The callback is called when the window loses or + /// gains input focus. + pub fn set_focus_callback(&self, callback: impl Fn(bool) + 'static) + { + self.inner.set_focus_callback(callback); + } } /// [`Window`] builder. |