This commit is contained in:
Nathan Sobo
2023-08-02 12:08:56 -06:00
parent 300ce61bd0
commit 60e190e500
2 changed files with 11 additions and 12 deletions
+5 -5
View File
@@ -3811,10 +3811,6 @@ pub struct WindowHandle<T> {
#[allow(dead_code)]
impl<V: View> WindowHandle<V> {
fn id(&self) -> usize {
self.any_handle.id()
}
fn new(window_id: usize, ref_counts: Arc<Mutex<RefCounts>>) -> Self {
WindowHandle {
any_handle: AnyWindowHandle::new::<V>(window_id, ref_counts),
@@ -3822,7 +3818,11 @@ impl<V: View> WindowHandle<V> {
}
}
fn root(&self, cx: &impl BorrowAppContext) -> ViewHandle<V> {
pub fn id(&self) -> usize {
self.any_handle.id()
}
pub fn root(&self, cx: &impl BorrowAppContext) -> ViewHandle<V> {
self.read_with(cx, |cx| cx.root_view().clone().downcast().unwrap())
}