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

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

Issue 1117143003: [Effen] Port fn.dart from the legacy sky.Node backend to the RenderNode backend, which is currently… (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Tweak debug functions as suggested 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/ink_well.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 'animated_component.dart'; 5 import 'animated_component.dart';
6 import '../animation/animated_value.dart'; 6 import '../animation/animated_value.dart';
7 import '../fn.dart'; 7 import '../fn.dart';
8 import '../theme/colors.dart'; 8 import '../theme/colors.dart';
9 import 'dart:async'; 9 import 'dart:async';
10 import 'dart:math' as math; 10 import 'dart:math' as math;
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 return null; 85 return null;
86 return ''' 86 return '''
87 opacity: ${math.min(1.0, _position * 3.0)}; 87 opacity: ${math.min(1.0, _position * 3.0)};
88 width: ${math.min(_width, _width * (0.5 + _position * 2.0))}px; 88 width: ${math.min(_width, _width * (0.5 + _position * 2.0))}px;
89 height: ${math.min(_height, _height * _position * 1.5)}px;'''; 89 height: ${math.min(_height, _height * _position * 1.5)}px;''';
90 } 90 }
91 91
92 void _measureSize() { 92 void _measureSize() {
93 setState(() { 93 setState(() {
94 var root = getRoot(); 94 var root = getRoot();
95 _width = root.clientWidth; 95 _width = root.width.round();
96 _height = root.clientHeight; 96 _height = root.height.round();
97 }); 97 });
98 } 98 }
99 99
100 UINode build() { 100 UINode build() {
101 int i = 0; 101 int i = 0;
102 List<UINode> children = new List.from(items.map((List<UINode> item) { 102 List<UINode> children = new List.from(items.map((List<UINode> item) {
103 double opacity = _opacityFor(i); 103 double opacity = _opacityFor(i);
104 return new PopupMenuItem(key: i++, children: item, opacity: opacity); 104 return new PopupMenuItem(key: i++, children: item, opacity: opacity);
105 })); 105 }));
106 106
107 return new Material( 107 return new Material(
108 content: new Container( 108 content: new Container(
109 style: _style, 109 style: _style,
110 inlineStyle: _inlineStyle(), 110 inlineStyle: _inlineStyle(),
111 children: children 111 children: children
112 ), 112 ),
113 level: level); 113 level: level);
114 } 114 }
115 } 115 }
OLDNEW
« no previous file with comments | « sky/framework/components/ink_well.dart ('k') | sky/framework/fn.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698