Make platform input handler private
Automatically record the context on non-view input handlers Simplify the async window context update() method
This commit is contained in:
parent
0858db9ebb
commit
33105486aa
17 changed files with 229 additions and 148 deletions
|
@ -213,7 +213,12 @@ impl AsyncWindowContext {
|
|||
}
|
||||
|
||||
/// A convenience method for [WindowContext::update()]
|
||||
pub fn update<R>(
|
||||
pub fn update<R>(&mut self, update: impl FnOnce(&mut WindowContext) -> R) -> Result<R> {
|
||||
self.app.update_window(self.window, |_, cx| update(cx))
|
||||
}
|
||||
|
||||
/// A convenience method for [WindowContext::update()]
|
||||
pub fn update_root<R>(
|
||||
&mut self,
|
||||
update: impl FnOnce(AnyView, &mut WindowContext) -> R,
|
||||
) -> Result<R> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue