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

Side by Side Diff: sky/framework/components/menu_item.dart

Issue 983903003: Re-work MaterialComponent (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: rebase Created 5 years, 9 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 unified diff | Download patch
« no previous file with comments | « sky/framework/components/material.dart ('k') | sky/framework/components/radio.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 '../fn.dart'; 5 import '../fn.dart';
6 import 'button_base.dart'; 6 import 'button_base.dart';
7 import 'icon.dart'; 7 import 'icon.dart';
8 import 'material.dart';
8 9
9 class MenuItem extends ButtonBase { 10 class MenuItem extends ButtonBase {
10 static final Style _style = new Style(''' 11 static final Style _style = new Style('''
11 transform: translateX(0); 12 transform: translateX(0);
12 display: flex; 13 display: flex;
13 align-items: center; 14 align-items: center;
14 height: 48px; 15 height: 48px;
15 -webkit-user-select: none;''' 16 -webkit-user-select: none;'''
16 ); 17 );
17 18
(...skipping 16 matching lines...) Expand all
34 padding: 0px 16px; 35 padding: 0px 16px;
35 flex: 1;''' 36 flex: 1;'''
36 ); 37 );
37 38
38 List<Node> children; 39 List<Node> children;
39 String icon; 40 String icon;
40 41
41 MenuItem({ Object key, this.icon, this.children }) : super(key: key); 42 MenuItem({ Object key, this.icon, this.children }) : super(key: key);
42 43
43 Node build() { 44 Node build() {
44 return new Container( 45 return new Material (
45 style: highlight ? _highlightStyle : _style, 46 style: highlight ? _highlightStyle : _style,
46 children: [ 47 children: [
47 super.build(),
48 new Icon( 48 new Icon(
49 style: _iconStyle, 49 style: _iconStyle,
50 size: 24, 50 size: 24,
51 type: "${icon}_grey600" 51 type: "${icon}_grey600"
52 ), 52 ),
53 new Container( 53 new Container(
54 style: _labelStyle, 54 style: _labelStyle,
55 children: children 55 children: children
56 ) 56 )
57 ] 57 ]
58 ); 58 );
59 } 59 }
60 } 60 }
OLDNEW
« no previous file with comments | « sky/framework/components/material.dart ('k') | sky/framework/components/radio.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698