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

Side by Side Diff: sky/sdk/lib/widgets/basic.dart

Issue 1215613005: Improve the padding and sizing of popup menus. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 5 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; 5 import 'dart:sky' as sky;
6 6
7 import 'package:vector_math/vector_math.dart'; 7 import 'package:vector_math/vector_math.dart';
8 8
9 import '../painting/text_style.dart'; 9 import '../painting/text_style.dart';
10 import '../rendering/block.dart'; 10 import '../rendering/block.dart';
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 RenderConstrainedBox createNode() => new RenderConstrainedBox(additionalConstr aints: constraints); 224 RenderConstrainedBox createNode() => new RenderConstrainedBox(additionalConstr aints: constraints);
225 225
226 void syncRenderObject(ConstrainedBox old) { 226 void syncRenderObject(ConstrainedBox old) {
227 super.syncRenderObject(old); 227 super.syncRenderObject(old);
228 root.additionalConstraints = constraints; 228 root.additionalConstraints = constraints;
229 } 229 }
230 230
231 } 231 }
232 232
233 class ShrinkWrapWidth extends OneChildRenderObjectWrapper { 233 class ShrinkWrapWidth extends OneChildRenderObjectWrapper {
234 ShrinkWrapWidth({ String key, Widget child }) 234
235 : super(key: key, child: child); 235 ShrinkWrapWidth({
236 String key,
237 this.stepWidth,
238 this.stepHeight,
239 Widget child
240 }): super(key: key, child: child);
236 241
237 RenderShrinkWrapWidth get root => super.root; 242 RenderShrinkWrapWidth get root => super.root;
243
244 final double stepWidth;
245 final double stepHeight;
246
238 RenderShrinkWrapWidth createNode() => new RenderShrinkWrapWidth(); 247 RenderShrinkWrapWidth createNode() => new RenderShrinkWrapWidth();
248
249 void syncRenderObject(ShrinkWrapWidth old) {
250 super.syncRenderObject(old);
251 root.stepWidth = stepWidth;
252 root.stepHeight = stepHeight;
253 }
254
239 } 255 }
240 256
241 class SizeObserver extends OneChildRenderObjectWrapper { 257 class SizeObserver extends OneChildRenderObjectWrapper {
242 258
243 SizeObserver({ String key, this.callback, Widget child }) 259 SizeObserver({ String key, this.callback, Widget child })
244 : super(key: key, child: child); 260 : super(key: key, child: child);
245 261
246 RenderSizeObserver get root => super.root; 262 RenderSizeObserver get root => super.root;
247 final SizeChangedCallback callback; 263 final SizeChangedCallback callback;
248 264
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after
489 } 505 }
490 506
491 void remove() { 507 void remove() {
492 RenderObjectWrapper ancestor = findAncestor(RenderObjectWrapper); 508 RenderObjectWrapper ancestor = findAncestor(RenderObjectWrapper);
493 assert(ancestor is RenderObjectWrapper); 509 assert(ancestor is RenderObjectWrapper);
494 ancestor.detachChildRoot(this); 510 ancestor.detachChildRoot(this);
495 super.remove(); 511 super.remove();
496 } 512 }
497 513
498 } 514 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698