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

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

Issue 1137373004: [Effen] Make the stock app use the radio button widget so that it's being tested. (Closed) Base URL: https://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 unified diff | Download patch
« no previous file with comments | « sky/examples/stocks/lib/stock_app.dart ('k') | sky/framework/fn.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 '../layout.dart';
6 import 'button_base.dart'; 7 import 'button_base.dart';
7 import 'icon.dart'; 8 import 'icon.dart';
8 import 'ink_well.dart'; 9 import 'ink_well.dart';
9 10
10 class MenuItem extends ButtonBase { 11 class MenuItem extends ButtonBase {
11 static final Style _style = new Style(''' 12 static final Style _style = new Style('''
12 align-items: center; 13 align-items: center;
13 height: 48px; 14 height: 48px;
14 -webkit-user-select: none;''' 15 -webkit-user-select: none;'''
15 ); 16 );
16 17
17 static final Style _highlightStyle = new Style(''' 18 static final Style _highlightStyle = new Style('''
18 align-items: center; 19 align-items: center;
19 height: 48px; 20 height: 48px;
20 background: rgba(153, 153, 153, 0.4); 21 background: rgba(153, 153, 153, 0.4);
21 -webkit-user-select: none;''' 22 -webkit-user-select: none;'''
22 ); 23 );
23 24
24 static final Style _iconStyle = new Style(''' 25 static final Style _iconStyle = new Style('''
25 padding: 0px 16px;''' 26 padding: 0px 16px;'''
26 ); 27 );
27 28
28 static final Style _labelStyle = new Style(''' 29 static final Style _labelStyle = new Style('''
29 padding: 0px 16px; 30 padding: 0px 16px;
30 flex: 1;''' 31 flex: 1;'''
31 ); 32 );
32 33
33 List<UINode> children; 34 List<UINode> children;
34 String icon; 35 String icon;
36 GestureEventListener onGestureTap;
35 37
36 MenuItem({ Object key, this.icon, this.children }) : super(key: key); 38 MenuItem({ Object key, this.icon, this.children, this.onGestureTap }) : super( key: key);
37 39
38 UINode buildContent() { 40 UINode buildContent() {
39 return new StyleNode( 41 return new EventListenerNode(
40 new InkWell( 42 new StyleNode(
41 children: [ 43 new InkWell(
42 new StyleNode( 44 children: [
43 new Icon( 45 new StyleNode(
44 size: 24, 46 new Icon(
45 type: "${icon}_grey600" 47 size: 24,
48 type: "${icon}_grey600"
49 ),
50 _iconStyle
46 ), 51 ),
47 _iconStyle 52 new FlexContainer(
48 ), 53 direction: FlexDirection.Row,
49 new Container( 54 style: _labelStyle,
50 style: _labelStyle, 55 children: children
51 children: children 56 )
52 ) 57 ]
53 ] 58 ),
59 highlight ? _highlightStyle : _style
54 ), 60 ),
55 highlight ? _highlightStyle : _style 61 onGestureTap: onGestureTap
56 ); 62 );
57 } 63 }
58 } 64 }
OLDNEW
« no previous file with comments | « sky/examples/stocks/lib/stock_app.dart ('k') | sky/framework/fn.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698