Extend Sky's RenderFlex with intrinsic sizes and compute cross-size height
Renders interactive_flex and stocks demos fine. Could use more testing, so I'm going to work on that after I land this. R=abarth@chromium.org, abarth Review URL: https://codereview.chromium.org/1173493003
This commit is contained in:
@@ -14,19 +14,27 @@ class RenderSolidColorBox extends RenderDecoratedBox {
|
||||
super(decoration: new BoxDecoration(backgroundColor: backgroundColor));
|
||||
|
||||
double getMinIntrinsicWidth(BoxConstraints constraints) {
|
||||
return constraints.constrainWidth(desiredSize.width);
|
||||
return constraints.constrainHeight(
|
||||
this.desiredSize == Size.infinite ? 0.0 : desiredSize.width
|
||||
);
|
||||
}
|
||||
|
||||
double getMaxIntrinsicWidth(BoxConstraints constraints) {
|
||||
return constraints.constrainWidth(desiredSize.width);
|
||||
return constraints.constrainWidth(
|
||||
this.desiredSize == Size.infinite ? 0.0 : desiredSize.width
|
||||
);
|
||||
}
|
||||
|
||||
double getMinIntrinsicHeight(BoxConstraints constraints) {
|
||||
return constraints.constrainHeight(desiredSize.height);
|
||||
return constraints.constrainHeight(
|
||||
this.desiredSize == Size.infinite ? 0.0 : desiredSize.height
|
||||
);
|
||||
}
|
||||
|
||||
double getMaxIntrinsicHeight(BoxConstraints constraints) {
|
||||
return constraints.constrainHeight(desiredSize.height);
|
||||
return constraints.constrainHeight(
|
||||
this.desiredSize == Size.infinite ? 0.0 : desiredSize.height
|
||||
);
|
||||
}
|
||||
|
||||
void performLayout() {
|
||||
|
||||
@@ -27,7 +27,7 @@ class StockMenu extends Component {
|
||||
items: [
|
||||
[new Text('Add stock')],
|
||||
[new Text('Remove stock')],
|
||||
// [new FlexExpandingChild(new Text('Autorefresh')), checkbox],
|
||||
[new FlexExpandingChild(new Text('Autorefresh')), checkbox],
|
||||
],
|
||||
level: 4
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user