Add a Flexible element that works like in Flutter
This commit is contained in:
@@ -191,7 +191,7 @@ impl Pane {
|
||||
let border = &theme.workspace.tab.container.border;
|
||||
|
||||
row.add_child(
|
||||
Expanded::new(
|
||||
Flexible::new(
|
||||
1.0,
|
||||
MouseEventHandler::new::<Tab, _, _, _>(item.id(), cx, |mouse_state, cx| {
|
||||
let title = item.title(cx);
|
||||
|
||||
@@ -113,9 +113,13 @@ impl Sidebar {
|
||||
container.add_child(self.render_resize_handle(settings, cx));
|
||||
}
|
||||
container.add_child(
|
||||
ConstrainedBox::new(ChildView::new(active_item.id()).boxed())
|
||||
.with_width(*self.width.borrow())
|
||||
.boxed(),
|
||||
Flexible::new(
|
||||
1.,
|
||||
ConstrainedBox::new(ChildView::new(active_item.id()).boxed())
|
||||
.with_max_width(*self.width.borrow())
|
||||
.boxed(),
|
||||
)
|
||||
.boxed(),
|
||||
);
|
||||
if matches!(self.side, Side::Left) {
|
||||
container.add_child(self.render_resize_handle(settings, cx));
|
||||
|
||||
Reference in New Issue
Block a user