From feaab953a8d74206423044db83c60300c7a32678 Mon Sep 17 00:00:00 2001 From: Antonio Scandurra Date: Fri, 3 Nov 2023 14:41:37 +0100 Subject: [PATCH] Add `ViewContext::window_context` --- crates/gpui2/src/window.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/crates/gpui2/src/window.rs b/crates/gpui2/src/window.rs index 8f9538001d..2284f3ccc2 100644 --- a/crates/gpui2/src/window.rs +++ b/crates/gpui2/src/window.rs @@ -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(&mut self, order: u32, f: impl FnOnce(&mut Self) -> R) -> R { self.window.z_index_stack.push(order); let result = f(self);