Unify Flexible and Expanded elements
We'll use the name Expanded for something else now. Co-Authored-By: Nathan Sobo <nathan@zed.dev>
This commit is contained in:
parent
b19d92e918
commit
1f762e482d
11 changed files with 58 additions and 145 deletions
|
@ -135,19 +135,16 @@ impl Sidebar {
|
|||
}
|
||||
|
||||
container.add_child(
|
||||
Flexible::new(
|
||||
1.,
|
||||
Hook::new(
|
||||
ConstrainedBox::new(ChildView::new(active_item.id()).boxed())
|
||||
.with_max_width(*self.width.borrow())
|
||||
.boxed(),
|
||||
)
|
||||
.on_after_layout({
|
||||
let width = self.width.clone();
|
||||
move |size, _| *width.borrow_mut() = size.x()
|
||||
})
|
||||
.boxed(),
|
||||
Hook::new(
|
||||
ConstrainedBox::new(ChildView::new(active_item.id()).boxed())
|
||||
.with_max_width(*self.width.borrow())
|
||||
.boxed(),
|
||||
)
|
||||
.on_after_layout({
|
||||
let width = self.width.clone();
|
||||
move |size, _| *width.borrow_mut() = size.x()
|
||||
})
|
||||
.flexible(1., false)
|
||||
.boxed(),
|
||||
);
|
||||
if matches!(self.side, Side::Left) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue