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

Side by Side Diff: sky/examples/fn/widgets/menuitem.dart

Issue 975863003: Don't hardcode the list of events types in fn (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: More careful event syncing 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/examples/fn/widgets/material.dart ('k') | sky/examples/fn/widgets/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 part of widgets;
2 2
3 class MenuItem extends ButtonBase { 3 class MenuItem extends ButtonBase {
4 4
5 static Style _style = new Style(''' 5 static Style _style = new Style('''
6 transform: translateX(0); 6 transform: translateX(0);
7 display: flex; 7 display: flex;
8 align-items: center; 8 align-items: center;
9 height: 48px; 9 height: 48px;
10 -webkit-user-select: none;''' 10 -webkit-user-select: none;'''
(...skipping 15 matching lines...) Expand all
26 static Style _labelStyle = new Style(''' 26 static Style _labelStyle = new Style('''
27 font-family: 'Roboto Medium', 'Helvetica'; 27 font-family: 'Roboto Medium', 'Helvetica';
28 color: #212121; 28 color: #212121;
29 padding: 0px 16px; 29 padding: 0px 16px;
30 flex: 1;''' 30 flex: 1;'''
31 ); 31 );
32 32
33 List<Node> children; 33 List<Node> children;
34 String icon; 34 String icon;
35 35
36 sky.EventListener onClick; 36 MenuItem({ Object key, this.icon, this.children }) : super(key: key);
37
38 MenuItem({ Object key, this.icon, this.children, this.onClick }) : super(key: key) {
39 }
40 37
41 Node render() { 38 Node render() {
42 return new Container( 39 return new Container(
43 style: _highlight ? _highlightStyle : _style, 40 style: _highlight ? _highlightStyle : _style,
44 onClick: onClick,
45 onPointerDown: _handlePointerDown,
46 onPointerUp: _handlePointerUp,
47 onPointerCancel: _handlePointerCancel,
48 children: [ 41 children: [
49 super.render(), 42 super.render(),
50 new Icon( 43 new Icon(
51 style: _iconStyle, 44 style: _iconStyle,
52 size: 24, 45 size: 24,
53 type: "${icon}_grey600" 46 type: "${icon}_grey600"
54 ), 47 ),
55 new Container( 48 new Container(
56 style: _labelStyle, 49 style: _labelStyle,
57 children: children 50 children: children
58 ) 51 )
59 ] 52 ]
60 ); 53 );
61 } 54 }
62 } 55 }
OLDNEW
« no previous file with comments | « sky/examples/fn/widgets/material.dart ('k') | sky/examples/fn/widgets/radio.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698