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

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

Issue 1132063007: Rationalize Dart mojo and sky package structure (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/framework/components/menu_divider.dart ('k') | sky/framework/components/modal_overlay.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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 '../layout.dart';
7 import 'button_base.dart';
8 import 'icon.dart';
9 import 'ink_well.dart';
10
11 class MenuItem extends ButtonBase {
12 static final Style _style = new Style('''
13 align-items: center;
14 height: 48px;
15 -webkit-user-select: none;'''
16 );
17
18 static final Style _highlightStyle = new Style('''
19 align-items: center;
20 height: 48px;
21 background: rgba(153, 153, 153, 0.4);
22 -webkit-user-select: none;'''
23 );
24
25 static final Style _iconStyle = new Style('''
26 padding: 0px 16px;'''
27 );
28
29 static final Style _labelStyle = new Style('''
30 padding: 0px 16px;'''
31 );
32
33 static final FlexBoxParentData _labelFlex = new FlexBoxParentData()..flex = 1;
34
35 List<UINode> children;
36 String icon;
37 GestureEventListener onGestureTap;
38
39 MenuItem({ Object key, this.icon, this.children, this.onGestureTap }) : super( key: key);
40
41 UINode buildContent() {
42 return new EventListenerNode(
43 new StyleNode(
44 new InkWell(
45 children: [
46 new StyleNode(
47 new Icon(
48 size: 24,
49 type: "${icon}_grey600"
50 ),
51 _iconStyle
52 ),
53 new ParentDataNode(
54 new FlexContainer(
55 direction: FlexDirection.Row,
56 style: _labelStyle,
57 children: children
58 ),
59 _labelFlex
60 )
61 ]
62 ),
63 highlight ? _highlightStyle : _style
64 ),
65 onGestureTap: onGestureTap
66 );
67 }
68 }
OLDNEW
« no previous file with comments | « sky/framework/components/menu_divider.dart ('k') | sky/framework/components/modal_overlay.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698