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

Side by Side Diff: sky/sdk/lib/framework/components2/menu_item.dart

Issue 1161323004: Export Point, Size, Rect, Color, Paint, Path, BoxDecoration, Border, BorderSide, EdgeDims, and Flex… (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: without analyser changes Created 5 years, 6 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
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 'dart:sky' as sky;
6 import '../fn2.dart'; 5 import '../fn2.dart';
7 import '../rendering/box.dart';
8 import '../rendering/flex.dart';
9 import 'button_base.dart'; 6 import 'button_base.dart';
10 import 'icon.dart'; 7 import 'icon.dart';
11 import 'ink_well.dart'; 8 import 'ink_well.dart';
12 9
13 class MenuItem extends ButtonBase { 10 class MenuItem extends ButtonBase {
14 11
15 static const BoxDecoration highlightDecoration = const BoxDecoration( 12 static const BoxDecoration highlightDecoration = const BoxDecoration(
16 backgroundColor: const sky.Color.fromARGB(102, 153, 153, 153) 13 backgroundColor: const Color.fromARGB(102, 153, 153, 153)
17 ); 14 );
18 15
19 List<UINode> children; 16 List<UINode> children;
20 String icon; 17 String icon;
21 GestureEventListener onGestureTap; 18 GestureEventListener onGestureTap;
22 19
23 MenuItem({ Object key, this.icon, this.children, this.onGestureTap }) : super( key: key); 20 MenuItem({ Object key, this.icon, this.children, this.onGestureTap }) : super( key: key);
24 21
25 UINode buildContent() { 22 UINode buildContent() {
26 return new EventListenerNode( 23 return new EventListenerNode(
27 new Container( 24 new Container(
28 child: new InkWell( 25 child: new InkWell(
29 children: [ 26 children: [
30 new Padding( 27 new Padding(
31 child: new Icon(type: "${icon}_grey600", size: 24), 28 child: new Icon(type: "${icon}_grey600", size: 24),
32 padding: const EdgeDims.symmetric(horizontal: 16.0) 29 padding: const EdgeDims.symmetric(horizontal: 16.0)
33 ), 30 ),
34 new FlexExpandingChild( 31 new FlexExpandingChild(
35 new Padding( 32 new Padding(
36 child: new FlexContainer( 33 child: new FlexContainer(
37 direction: FlexDirection.horizontal, 34 direction: FlexDirection.horizontal,
38 children: children 35 children: children
39 ), 36 ),
40 padding: const EdgeDims.symmetric(horizontal: 16.0) 37 padding: const EdgeDims.symmetric(horizontal: 16.0)
41 ), 38 ),
42 1 39 1
43 ) 40 )
44 ] 41 ]
45 ), 42 ),
46 desiredSize: const sky.Size.fromHeight(48.0), 43 desiredSize: const Size.fromHeight(48.0),
47 decoration: highlight ? highlightDecoration : null 44 decoration: highlight ? highlightDecoration : null
48 ), 45 ),
49 onGestureTap: onGestureTap 46 onGestureTap: onGestureTap
50 ); 47 );
51 } 48 }
52 } 49 }
OLDNEW
« no previous file with comments | « sky/sdk/lib/framework/components2/menu_divider.dart ('k') | sky/sdk/lib/framework/components2/radio.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698