Add focusable view and restore workspace deserialization. Partially restore split and tab functions

This commit is contained in:
Mikayla 2023-11-15 16:36:43 -08:00
parent e905ababcd
commit 78cea69172
No known key found for this signature in database
14 changed files with 173 additions and 110 deletions

View file

@ -1,7 +1,7 @@
use crate::{
private::Sealed, AnyBox, AnyElement, AnyModel, AnyWeakModel, AppContext, AvailableSpace,
Bounds, Component, Element, ElementId, Entity, EntityId, Flatten, LayoutId, Model, Pixels,
Size, ViewContext, VisualContext, WeakModel, WindowContext,
Bounds, Component, Element, ElementId, Entity, EntityId, Flatten, FocusHandle, FocusableView,
LayoutId, Model, Pixels, Size, ViewContext, VisualContext, WeakModel, WindowContext,
};
use anyhow::{Context, Result};
use std::{
@ -73,6 +73,13 @@ impl<V: 'static> View<V> {
component: Some(component),
}
}
pub fn focus_handle(&self, cx: &AppContext) -> FocusHandle
where
V: FocusableView,
{
self.read(cx).focus_handle(cx)
}
}
impl<V> Clone for View<V> {