Move views_to_notify_if_ancestors_change to Window
This commit is contained in:
@@ -38,10 +38,8 @@ use crate::{
|
||||
ViewContext, WeakViewHandle, WindowContext,
|
||||
};
|
||||
use anyhow::{anyhow, Result};
|
||||
use collections::HashMap;
|
||||
use core::panic;
|
||||
use json::ToJson;
|
||||
use smallvec::SmallVec;
|
||||
use std::{
|
||||
any::{type_name, Any},
|
||||
borrow::Cow,
|
||||
@@ -649,7 +647,6 @@ pub trait AnyRootElement {
|
||||
fn layout(
|
||||
&mut self,
|
||||
constraint: SizeConstraint,
|
||||
views_to_notify_if_ancestors_change: &mut HashMap<usize, SmallVec<[usize; 2]>>,
|
||||
refreshing: bool,
|
||||
cx: &mut WindowContext,
|
||||
) -> Result<Vector2F>;
|
||||
@@ -673,7 +670,6 @@ impl<V: View> AnyRootElement for RootElement<V> {
|
||||
fn layout(
|
||||
&mut self,
|
||||
constraint: SizeConstraint,
|
||||
views_to_notify_if_ancestors_change: &mut HashMap<usize, SmallVec<[usize; 2]>>,
|
||||
refreshing: bool,
|
||||
cx: &mut WindowContext,
|
||||
) -> Result<Vector2F> {
|
||||
@@ -682,7 +678,7 @@ impl<V: View> AnyRootElement for RootElement<V> {
|
||||
.upgrade(cx)
|
||||
.ok_or_else(|| anyhow!("layout called on a root element for a dropped view"))?;
|
||||
view.update(cx, |view, cx| {
|
||||
let mut cx = LayoutContext::new(cx, views_to_notify_if_ancestors_change, refreshing);
|
||||
let mut cx = LayoutContext::new(cx, refreshing);
|
||||
Ok(self.element.layout(constraint, view, &mut cx))
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user