OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 import '../rendering/flex.dart'; | 5 import '../rendering/flex.dart'; |
6 import '../theme2/shadows.dart'; | 6 import '../theme2/shadows.dart'; |
7 import '../theme2/view_configuration.dart'; | 7 import '../theme2/view_configuration.dart'; |
8 import 'basic.dart'; | 8 import 'basic.dart'; |
9 | 9 |
10 class ToolBar extends Component { | 10 class ToolBar extends Component { |
(...skipping 10 matching lines...) Expand all Loading... |
21 final UINode center; | 21 final UINode center; |
22 final List<UINode> right; | 22 final List<UINode> right; |
23 final Color backgroundColor; | 23 final Color backgroundColor; |
24 | 24 |
25 UINode build() { | 25 UINode build() { |
26 List<UINode> children = new List<UINode>(); | 26 List<UINode> children = new List<UINode>(); |
27 if (left != null) | 27 if (left != null) |
28 children.add(left); | 28 children.add(left); |
29 | 29 |
30 if (center != null) { | 30 if (center != null) { |
31 children.add(new FlexExpandingChild( | 31 children.add( |
32 new Padding(child: center, padding: new EdgeDims.only(left: 24.0)))); | 32 new Flexible( |
| 33 child: new Padding( |
| 34 child: center, |
| 35 padding: new EdgeDims.only(left: 24.0) |
| 36 ) |
| 37 ) |
| 38 ); |
33 } | 39 } |
34 | 40 |
35 if (right != null) | 41 if (right != null) |
36 children.addAll(right); | 42 children.addAll(right); |
37 | 43 |
38 return new Container( | 44 return new Container( |
39 child: new Flex( | 45 child: new Flex( |
40 [new Container(child: new Flex(children), height: kToolBarHeight)], | 46 [new Container(child: new Flex(children), height: kToolBarHeight)], |
41 alignItems: FlexAlignItems.flexEnd | 47 alignItems: FlexAlignItems.flexEnd |
42 ), | 48 ), |
43 padding: new EdgeDims.symmetric(horizontal: 8.0), | 49 padding: new EdgeDims.symmetric(horizontal: 8.0), |
44 decoration: new BoxDecoration( | 50 decoration: new BoxDecoration( |
45 backgroundColor: backgroundColor, | 51 backgroundColor: backgroundColor, |
46 boxShadow: shadows[2] | 52 boxShadow: shadows[2] |
47 ) | 53 ) |
48 ); | 54 ); |
49 } | 55 } |
50 | 56 |
51 } | 57 } |
OLD | NEW |