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

Side by Side Diff: samples/swarm/swarm_ui_lib/view/view.dart

Issue 12605003: Converting Element.client*, offset* and Screen.avail* over to Rects (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « samples/swarm/swarm_ui_lib/view/SliderMenu.dart ('k') | sdk/lib/html/dart2js/html_dart2js.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 (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library view; 5 library view;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:html'; 8 import 'dart:html';
9 import 'dart:math' as Math; 9 import 'dart:math' as Math;
10 10
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after
348 void _measureLayoutHelper(Completer<bool> changed) { 348 void _measureLayoutHelper(Completer<bool> changed) {
349 windowResized(); 349 windowResized();
350 350
351 // TODO(jmesserly): this logic is more complex than it needs to be because 351 // TODO(jmesserly): this logic is more complex than it needs to be because
352 // we're taking pains to not initialize _layout if it's not needed. Is that 352 // we're taking pains to not initialize _layout if it's not needed. Is that
353 // a good tradeoff? 353 // a good tradeoff?
354 if (ViewLayout.hasCustomLayout(this)) { 354 if (ViewLayout.hasCustomLayout(this)) {
355 Completer sizeCompleter = new Completer<Size>(); 355 Completer sizeCompleter = new Completer<Size>();
356 window.setImmediate(() { 356 window.setImmediate(() {
357 sizeCompleter.complete( 357 sizeCompleter.complete(
358 new Size(_node.clientWidth, _node.clientHeight)); 358 new Size(_node.client.width, _node.client.height));
359 }); 359 });
360 layout.measureLayout(sizeCompleter.future, changed); 360 layout.measureLayout(sizeCompleter.future, changed);
361 } else { 361 } else {
362 for (final child in childViews) { 362 for (final child in childViews) {
363 child._measureLayoutHelper(changed); 363 child._measureLayoutHelper(changed);
364 } 364 }
365 } 365 }
366 } 366 }
367 367
368 void _applyLayoutToChildren() { 368 void _applyLayoutToChildren() {
369 for (final child in childViews) { 369 for (final child in childViews) {
370 child._applyLayout(); 370 child._applyLayout();
371 } 371 }
372 } 372 }
373 373
374 void _applyLayout() { 374 void _applyLayout() {
375 if (_layout != null) { 375 if (_layout != null) {
376 _layout.applyLayout(); 376 _layout.applyLayout();
377 } 377 }
378 _applyLayoutToChildren(); 378 _applyLayoutToChildren();
379 } 379 }
380 } 380 }
OLDNEW
« no previous file with comments | « samples/swarm/swarm_ui_lib/view/SliderMenu.dart ('k') | sdk/lib/html/dart2js/html_dart2js.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698