Add ViewContext::window_context
This commit is contained in:
parent
77e3c7f8ee
commit
feaab953a8
1 changed files with 5 additions and 0 deletions
|
@ -1664,6 +1664,11 @@ impl<'a, V: 'static> ViewContext<'a, V> {
|
|||
self.view.model.clone()
|
||||
}
|
||||
|
||||
/// Access the underlying window context.
|
||||
pub fn window_context(&mut self) -> &mut WindowContext<'a> {
|
||||
&mut self.window_cx
|
||||
}
|
||||
|
||||
pub fn stack<R>(&mut self, order: u32, f: impl FnOnce(&mut Self) -> R) -> R {
|
||||
self.window.z_index_stack.push(order);
|
||||
let result = f(self);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue