diff --git a/sdk/lib/framework/components2/tool_bar.dart b/sdk/lib/framework/components2/tool_bar.dart index ea5dec223a4..a4df2eb8a32 100644 --- a/sdk/lib/framework/components2/tool_bar.dart +++ b/sdk/lib/framework/components2/tool_bar.dart @@ -35,15 +35,11 @@ class ToolBar extends Component { if (right != null) children.addAll(right); - // TODO(hansmuller): use align-items:flex-end when Flex supports it. - UINode bottomJustifiedChild = new Flex([ - new Container(child: new Flex(children), height: kToolBarHeight) - ], - direction: FlexDirection.vertical, - justifyContent: FlexJustifyContent.flexEnd); - return new Container( - child: bottomJustifiedChild, + child: new Flex( + [new Container(child: new Flex(children), height: kToolBarHeight)], + alignItems: FlexAlignItems.flexEnd + ), padding: new EdgeDims.symmetric(horizontal: 8.0), decoration: new BoxDecoration( backgroundColor: backgroundColor, diff --git a/sdk/lib/framework/fn2.dart b/sdk/lib/framework/fn2.dart index 1045eaf290e..32b05ab2a70 100644 --- a/sdk/lib/framework/fn2.dart +++ b/sdk/lib/framework/fn2.dart @@ -787,7 +787,8 @@ class Flex extends MultiChildRenderObjectWrapper { Flex(List children, { Object key, this.direction: FlexDirection.horizontal, - this.justifyContent: FlexJustifyContent.flexStart + this.justifyContent: FlexJustifyContent.flexStart, + this.alignItems: FlexAlignItems.center }) : super(key: key, children: children); RenderFlex get root { RenderFlex result = super.root; return result; } @@ -795,11 +796,13 @@ class Flex extends MultiChildRenderObjectWrapper { final FlexDirection direction; final FlexJustifyContent justifyContent; + final FlexAlignItems alignItems; void syncRenderObject(UINode old) { super.syncRenderObject(old); root.direction = direction; root.justifyContent = justifyContent; + root.alignItems = alignItems; } } diff --git a/sdk/lib/framework/rendering/flex.dart b/sdk/lib/framework/rendering/flex.dart index 4def9d2d094..dc08cd73dc0 100644 --- a/sdk/lib/framework/rendering/flex.dart +++ b/sdk/lib/framework/rendering/flex.dart @@ -19,6 +19,7 @@ class FlexBoxParentData extends BoxParentData with ContainerParentDataMixin, @@ -35,8 +42,9 @@ class RenderFlex extends RenderBox with ContainerRenderObjectMixin _direction; @@ -56,6 +64,15 @@ class RenderFlex extends RenderBox with ContainerRenderObjectMixin _alignItems; + void set alignItems (FlexAlignItems value) { + if (_alignItems != value) { + _alignItems = value; + markNeedsLayout(); + } + } + void setParentData(RenderBox child) { if (child.parentData is! FlexBoxParentData) child.parentData = new FlexBoxParentData(); @@ -334,7 +351,18 @@ class RenderFlex extends RenderBox with ContainerRenderObjectMixin