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

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

Issue 1219113003: Make popup menus line up to their baseline per the Material spec. (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 236 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 RenderShrinkWrapWidth createNode() => new RenderShrinkWrapWidth(); 247 RenderShrinkWrapWidth createNode() => new RenderShrinkWrapWidth();
248 248
249 void syncRenderObject(ShrinkWrapWidth old) { 249 void syncRenderObject(ShrinkWrapWidth old) {
250 super.syncRenderObject(old); 250 super.syncRenderObject(old);
251 root.stepWidth = stepWidth; 251 root.stepWidth = stepWidth;
252 root.stepHeight = stepHeight; 252 root.stepHeight = stepHeight;
253 } 253 }
254 254
255 } 255 }
256 256
257 class Baseline extends OneChildRenderObjectWrapper {
258
259 Baseline({
260 String key,
261 this.baseline, // in pixels
262 this.baselineType: TextBaseline.alphabetic,
263 Widget child
264 }): super(key: key, child: child);
265
266 RenderBaseline get root => super.root;
267
268 final double baseline;
269 final TextBaseline baselineType;
270
271 RenderBaseline createNode() => new RenderBaseline(baseline: baseline, baseline Type: baselineType);
272
273 void syncRenderObject(Baseline old) {
274 super.syncRenderObject(old);
275 root.baseline = baseline;
276 root.baselineType = baselineType;
277 }
278
279 }
280
257 class SizeObserver extends OneChildRenderObjectWrapper { 281 class SizeObserver extends OneChildRenderObjectWrapper {
258 282
259 SizeObserver({ String key, this.callback, Widget child }) 283 SizeObserver({ String key, this.callback, Widget child })
260 : super(key: key, child: child); 284 : super(key: key, child: child);
261 285
262 RenderSizeObserver get root => super.root; 286 RenderSizeObserver get root => super.root;
263 final SizeChangedCallback callback; 287 final SizeChangedCallback callback;
264 288
265 RenderSizeObserver createNode() => new RenderSizeObserver(callback: callback); 289 RenderSizeObserver createNode() => new RenderSizeObserver(callback: callback);
266 290
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after
505 } 529 }
506 530
507 void remove() { 531 void remove() {
508 RenderObjectWrapper ancestor = findAncestor(RenderObjectWrapper); 532 RenderObjectWrapper ancestor = findAncestor(RenderObjectWrapper);
509 assert(ancestor is RenderObjectWrapper); 533 assert(ancestor is RenderObjectWrapper);
510 ancestor.detachChildRoot(this); 534 ancestor.detachChildRoot(this);
511 super.remove(); 535 super.remove();
512 } 536 }
513 537
514 } 538 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698