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

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
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 flex: 1;'''
32 );
33
34 List<UINode> children;
35 String icon;
36 GestureEventListener onGestureTap;
37
38 MenuItem({ Object key, this.icon, this.children, this.onGestureTap }) : super( key: key);
39
40 UINode buildContent() {
41 return new EventListenerNode(
42 new StyleNode(
43 new InkWell(
44 children: [
45 new StyleNode(
46 new Icon(
47 size: 24,
48 type: "${icon}_grey600"
49 ),
50 _iconStyle
51 ),
52 new FlexContainer(
53 direction: FlexDirection.Row,
54 style: _labelStyle,
55 children: children
56 )
57 ]
58 ),
59 highlight ? _highlightStyle : _style
60 ),
61 onGestureTap: onGestureTap
62 );
63 }
64 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698