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

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

Issue 1043283003: [Effen] s/Node/UINode/, s/Element/WrapperNode/, s/EventTarget/EventListenerNode/ (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 8 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/ink_splash.dart ('k') | sky/framework/components/input.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 'dart:collection'; 6 import 'dart:collection';
7 import 'dart:sky' as sky; 7 import 'dart:sky' as sky;
8 import 'ink_splash.dart'; 8 import 'ink_splash.dart';
9 9
10 class InkWell extends Component { 10 class InkWell extends Component {
11 static final Style _containmentStyleHack = new Style(''' 11 static final Style _containmentStyleHack = new Style('''
12 transform: translateX(0);'''); 12 transform: translateX(0);''');
13 13
14 LinkedHashSet<SplashController> _splashes; 14 LinkedHashSet<SplashController> _splashes;
15 15
16 String inlineStyle; 16 String inlineStyle;
17 List<Node> children; 17 List<UINode> children;
18 18
19 InkWell({ Object key, this.inlineStyle, this.children }) 19 InkWell({ Object key, this.inlineStyle, this.children })
20 : super(key: key) { 20 : super(key: key) {
21 onDidUnmount(() { 21 onDidUnmount(() {
22 _cancelSplashes(null); 22 _cancelSplashes(null);
23 }); 23 });
24 } 24 }
25 25
26 Node build() { 26 UINode build() {
27 List<Node> childrenIncludingSplashes = []; 27 List<UINode> childrenIncludingSplashes = [];
28 28
29 if (_splashes != null) { 29 if (_splashes != null) {
30 childrenIncludingSplashes.addAll( 30 childrenIncludingSplashes.addAll(
31 _splashes.map((s) => new InkSplash(s.onStyleChanged))); 31 _splashes.map((s) => new InkSplash(s.onStyleChanged)));
32 } 32 }
33 33
34 if (children != null) 34 if (children != null)
35 childrenIncludingSplashes.addAll(children); 35 childrenIncludingSplashes.addAll(children);
36 36
37 return new EventTarget( 37 return new EventListenerNode(
38 new Container( 38 new Container(
39 style: _containmentStyleHack, 39 style: _containmentStyleHack,
40 inlineStyle: inlineStyle, 40 inlineStyle: inlineStyle,
41 children: childrenIncludingSplashes), 41 children: childrenIncludingSplashes),
42 onGestureTapDown: _startSplash, 42 onGestureTapDown: _startSplash,
43 onGestureTap: _confirmSplash 43 onGestureTap: _confirmSplash
44 ); 44 );
45 } 45 }
46 46
47 sky.ClientRect _getBoundingRect() => (getRoot() as sky.Element).getBoundingCli entRect(); 47 sky.ClientRect _getBoundingRect() => (getRoot() as sky.Element).getBoundingCli entRect();
(...skipping 30 matching lines...) Expand all
78 void _splashDone(SplashController splash) { 78 void _splashDone(SplashController splash) {
79 if (_splashes == null) 79 if (_splashes == null)
80 return; 80 return;
81 setState(() { 81 setState(() {
82 _splashes.remove(splash); 82 _splashes.remove(splash);
83 if (_splashes.length == 0) 83 if (_splashes.length == 0)
84 _splashes = null; 84 _splashes = null;
85 }); 85 });
86 } 86 }
87 } 87 }
OLDNEW
« no previous file with comments | « sky/framework/components/ink_splash.dart ('k') | sky/framework/components/input.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698