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

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

Issue 993033003: Move example fn widgets into sky/framework/components (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: 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/menu_divider.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 part of widgets; 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
3 // found in the LICENSE file.
4
5 import '../fn.dart';
6 import 'button_base.dart';
7 import 'icon.dart';
2 8
3 class MenuItem extends ButtonBase { 9 class MenuItem extends ButtonBase {
4 10 static final Style _style = new Style('''
5 static Style _style = new Style('''
6 transform: translateX(0); 11 transform: translateX(0);
7 display: flex; 12 display: flex;
8 align-items: center; 13 align-items: center;
9 height: 48px; 14 height: 48px;
10 -webkit-user-select: none;''' 15 -webkit-user-select: none;'''
11 ); 16 );
12 17
13 static Style _highlightStyle = new Style(''' 18 static final Style _highlightStyle = new Style('''
14 transform: translateX(0); 19 transform: translateX(0);
15 display: flex; 20 display: flex;
16 align-items: center; 21 align-items: center;
17 height: 48px; 22 height: 48px;
18 background: rgba(153, 153, 153, 0.4); 23 background: rgba(153, 153, 153, 0.4);
19 -webkit-user-select: none;''' 24 -webkit-user-select: none;'''
20 ); 25 );
21 26
22 static Style _iconStyle = new Style(''' 27 static final Style _iconStyle = new Style('''
23 padding: 0px 16px;''' 28 padding: 0px 16px;'''
24 ); 29 );
25 30
26 static Style _labelStyle = new Style(''' 31 static final Style _labelStyle = new Style('''
27 font-family: 'Roboto Medium', 'Helvetica'; 32 font-family: 'Roboto Medium', 'Helvetica';
28 color: #212121; 33 color: #212121;
29 padding: 0px 16px; 34 padding: 0px 16px;
30 flex: 1;''' 35 flex: 1;'''
31 ); 36 );
32 37
33 List<Node> children; 38 List<Node> children;
34 String icon; 39 String icon;
35 40
36 MenuItem({ Object key, this.icon, this.children }) : super(key: key); 41 MenuItem({ Object key, this.icon, this.children }) : super(key: key);
37 42
38 Node build() { 43 Node build() {
39 return new Container( 44 return new Container(
40 style: _highlight ? _highlightStyle : _style, 45 style: highlight ? _highlightStyle : _style,
41 children: [ 46 children: [
42 super.build(), 47 super.build(),
43 new Icon( 48 new Icon(
44 style: _iconStyle, 49 style: _iconStyle,
45 size: 24, 50 size: 24,
46 type: "${icon}_grey600" 51 type: "${icon}_grey600"
47 ), 52 ),
48 new Container( 53 new Container(
49 style: _labelStyle, 54 style: _labelStyle,
50 children: children 55 children: children
51 ) 56 )
52 ] 57 ]
53 ); 58 );
54 } 59 }
55 } 60 }
OLDNEW
« no previous file with comments | « sky/framework/components/menu_divider.dart ('k') | sky/framework/components/radio.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698