Eliminate LayoutContext
This commit is contained in:
parent
ebf8b32811
commit
a24d94cfda
35 changed files with 108 additions and 203 deletions
|
@ -25,8 +25,8 @@ use gpui::{
|
|||
keymap_matcher::KeymapContext,
|
||||
platform::{CursorStyle, MouseButton, NavigationDirection, PromptLevel},
|
||||
Action, AnyViewHandle, AnyWeakViewHandle, AppContext, AsyncAppContext, Entity, EventContext,
|
||||
LayoutContext, ModelHandle, MouseRegion, PaintContext, Quad, Task, View, ViewContext,
|
||||
ViewHandle, WeakViewHandle, WindowContext,
|
||||
ModelHandle, MouseRegion, PaintContext, Quad, Task, View, ViewContext, ViewHandle,
|
||||
WeakViewHandle, WindowContext,
|
||||
};
|
||||
use project::{Project, ProjectEntryId, ProjectPath};
|
||||
use serde::Deserialize;
|
||||
|
@ -1999,7 +1999,7 @@ impl<V: 'static> Element<V> for PaneBackdrop<V> {
|
|||
&mut self,
|
||||
constraint: gpui::SizeConstraint,
|
||||
view: &mut V,
|
||||
cx: &mut LayoutContext<V>,
|
||||
cx: &mut ViewContext<V>,
|
||||
) -> (Vector2F, Self::LayoutState) {
|
||||
let size = self.child.layout(constraint, view, cx);
|
||||
(size, ())
|
||||
|
|
|
@ -594,8 +594,8 @@ mod element {
|
|||
json::{self, ToJson},
|
||||
platform::{CursorStyle, MouseButton},
|
||||
scene::MouseDrag,
|
||||
AnyElement, Axis, CursorRegion, Element, EventContext, LayoutContext, MouseRegion,
|
||||
PaintContext, RectFExt, SizeConstraint, Vector2FExt, ViewContext,
|
||||
AnyElement, Axis, CursorRegion, Element, EventContext, MouseRegion, PaintContext, RectFExt,
|
||||
SizeConstraint, Vector2FExt, ViewContext,
|
||||
};
|
||||
|
||||
use crate::{
|
||||
|
@ -641,7 +641,7 @@ mod element {
|
|||
remaining_flex: &mut f32,
|
||||
cross_axis_max: &mut f32,
|
||||
view: &mut Workspace,
|
||||
cx: &mut LayoutContext<Workspace>,
|
||||
cx: &mut ViewContext<Workspace>,
|
||||
) {
|
||||
let flexes = self.flexes.borrow();
|
||||
let cross_axis = self.axis.invert();
|
||||
|
@ -789,7 +789,7 @@ mod element {
|
|||
&mut self,
|
||||
constraint: SizeConstraint,
|
||||
view: &mut Workspace,
|
||||
cx: &mut LayoutContext<Workspace>,
|
||||
cx: &mut ViewContext<Workspace>,
|
||||
) -> (Vector2F, Self::LayoutState) {
|
||||
debug_assert!(self.children.len() == self.flexes.borrow().len());
|
||||
|
||||
|
|
|
@ -8,8 +8,8 @@ use gpui::{
|
|||
vector::{vec2f, Vector2F},
|
||||
},
|
||||
json::{json, ToJson},
|
||||
AnyElement, AnyViewHandle, Entity, LayoutContext, PaintContext, SizeConstraint, Subscription,
|
||||
View, ViewContext, ViewHandle, WindowContext,
|
||||
AnyElement, AnyViewHandle, Entity, PaintContext, SizeConstraint, Subscription, View,
|
||||
ViewContext, ViewHandle, WindowContext,
|
||||
};
|
||||
|
||||
pub trait StatusItemView: View {
|
||||
|
@ -208,7 +208,7 @@ impl Element<StatusBar> for StatusBarElement {
|
|||
&mut self,
|
||||
mut constraint: SizeConstraint,
|
||||
view: &mut StatusBar,
|
||||
cx: &mut LayoutContext<StatusBar>,
|
||||
cx: &mut ViewContext<StatusBar>,
|
||||
) -> (Vector2F, Self::LayoutState) {
|
||||
let max_width = constraint.max.x();
|
||||
constraint.min = vec2f(0., constraint.min.y());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue