go to line2 (#3261)

- MODAL
- center a div
- MOAR CODE
- Beautiful go to line modal


Release Notes:
- N/A
This commit is contained in:
Conrad Irwin 2023-11-08 17:16:00 -07:00 committed by GitHub
commit b90e34aeb2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
24 changed files with 535 additions and 338 deletions

View file

@ -1438,7 +1438,7 @@ impl VisualContext for WindowContext<'_> {
build_view_state: impl FnOnce(&mut ViewContext<'_, V>) -> V,
) -> Self::Result<View<V>>
where
V: 'static,
V: 'static + Render,
{
let slot = self.app.entities.reserve();
let view = View {
@ -1446,7 +1446,16 @@ impl VisualContext for WindowContext<'_> {
};
let mut cx = ViewContext::new(&mut *self.app, &mut *self.window, &view);
let entity = build_view_state(&mut cx);
self.entities.insert(slot, entity);
cx.entities.insert(slot, entity);
cx.new_view_observers
.clone()
.retain(&TypeId::of::<V>(), |observer| {
let any_view = AnyView::from(view.clone());
(observer)(any_view, self);
true
});
view
}
@ -2233,7 +2242,7 @@ impl<V> Context for ViewContext<'_, V> {
}
impl<V: 'static> VisualContext for ViewContext<'_, V> {
fn build_view<W: 'static>(
fn build_view<W: Render + 'static>(
&mut self,
build_view_state: impl FnOnce(&mut ViewContext<'_, W>) -> W,
) -> Self::Result<View<W>> {