summaryrefslogtreecommitdiff
path: root/engine
diff options
context:
space:
mode:
authorHampusM <hampus@hampusmat.com>2024-05-18 17:34:13 +0200
committerHampusM <hampus@hampusmat.com>2024-05-18 17:34:13 +0200
commitbcf1e9c00e3959c3db047d2d8b3ac7d6c4853796 (patch)
tree871b12ca77f0d3d30139c2b5a8830e1eb0cf837d /engine
parent35df7a829852c1dfc51be6b02678e631ce7f4d1b (diff)
feat(engine): add Window function to set focus callback
Diffstat (limited to 'engine')
-rw-r--r--engine/src/window.rs7
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.