chore: adapt latest changes from GPUI and nostr-sdk

This commit is contained in:
2025-01-30 08:03:39 +07:00
parent 72a6d79bc5
commit 82f18fc478
19 changed files with 276 additions and 186 deletions

View File

@@ -5,8 +5,8 @@ use crate::{
window_border,
};
use gpui::{
div, AnyView, App, AppContext, Context, DefiniteLength, Entity, FocusHandle,
InteractiveElement, IntoElement, ParentElement as _, Render, Styled, Window,
div, AnyView, App, AppContext, Context, Entity, FocusHandle, InteractiveElement, IntoElement,
ParentElement as _, Render, Styled, Window,
};
use std::rc::Rc;
@@ -195,14 +195,14 @@ impl Root {
where
F: FnOnce(&mut Self, &mut Window, &mut Context<Self>) + 'static,
{
if let Some(Some(root)) = window.root_model::<Root>() {
if let Some(Some(root)) = window.root::<Root>() {
root.update(cx, |root, cx| f(root, window, cx));
}
}
pub fn read<'a>(window: &'a mut Window, cx: &'a mut App) -> &'a Self {
window
.root_model::<Root>()
.root::<Root>()
.expect("The window root view should be of type `ui::Root`.")
.unwrap()
.read(cx)
@@ -219,15 +219,14 @@ impl Root {
window: &mut Window,
cx: &mut App,
) -> Option<impl IntoElement> {
let root = window.root_model::<Root>()??;
let root = window.root::<Root>()??;
Some(div().child(root.read(cx).notification.clone()))
}
/// Render the Modal layer.
pub fn render_modal_layer(window: &mut Window, cx: &mut App) -> Option<impl IntoElement> {
let root = window.root_model::<Root>()??;
let root = window.root::<Root>()??;
let active_modals = root.read(cx).active_modals.clone();
let mut has_overlay = false;