Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1096)

Unified Diff: sky/sdk/lib/framework/components2/tool_bar.dart

Issue 1146913005: Give the Stocks2 App a new improved toolbar. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: sky/sdk/lib/framework/components2/tool_bar.dart
diff --git a/sky/sdk/lib/framework/components2/tool_bar.dart b/sky/sdk/lib/framework/components2/tool_bar.dart
index f0f3ee443b3000046b8945c4425488c860afc7a5..c34e639a67a27eaf9dc66a5ef992372d04bfcd67 100644
--- a/sky/sdk/lib/framework/components2/tool_bar.dart
+++ b/sky/sdk/lib/framework/components2/tool_bar.dart
@@ -2,44 +2,48 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+import 'dart:sky' as sky;
import '../fn2.dart';
import '../theme/view_configuration.dart';
-import 'material.dart';
+import '../rendering/box.dart';
+import '../rendering/flex.dart';
+// import 'material.dart';
class ToolBar extends Component {
- static final Style _style = new Style('''
- align-items: center;
- height: 56px;
- padding: 0 8px;
- transition: background-color 0.3s;
- padding-top: ${kStatusBarHeight}px;''');
-
- static Style _centerStyle = new Style('''
- padding-left: 24px;''');
-
- static FlexBoxParentData _centerLayoutSettings = new FlexBoxParentData()..flex = 1;
-
UINode left;
UINode center;
List<UINode> right;
+ sky.Color backgroundColor;
ToolBar({
String key,
this.left,
this.center,
- this.right
+ this.right,
+ this.backgroundColor
}) : super(key: key);
UINode build() {
- List<UINode> children = [left, new StyleNode(new ParentDataNode(center, _centerLayoutSettings), _centerStyle)];
+ List<UINode> children = [
+ left,
+ new FlexExpandingChild(
+ new Padding(
+ child: center,
+ padding: new EdgeDims.onlyLeft(24.0)
+ ))
+ ];
if (right != null)
children.addAll(right);
- return new Material(
- content: new FlexContainer(
+ return new Container(
+ child: new FlexContainer(
children: children,
- direction: FlexDirection.Row),
- level: 2);
+ direction: FlexDirection.Horizontal
+ ),
+ desiredSize: new sky.Size.onlyHeight(56.0),
+ // padding: new EdgeDims(kStatusBarHeight.toDouble(), 8.0, 0.0, 8.0),
+ decoration: new BoxDecoration(backgroundColor: backgroundColor.value)
+ );
}
}

Powered by Google App Engine
This is Rietveld 408576698