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

Side by Side Diff: sky/framework/fn.dart

Issue 1128743003: [Effen] Convert action_bar.dart to using a FlexContainer. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: make the 'direction' argument have a default value 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/action_bar.dart ('k') | sky/framework/layout.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 library fn; 5 library fn;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:collection'; 8 import 'dart:collection';
9 import 'dart:sky' as sky; 9 import 'dart:sky' as sky;
10 import 'reflect.dart' as reflect; 10 import 'reflect.dart' as reflect;
(...skipping 525 matching lines...) Expand 10 before | Expand all | Expand 10 after
536 Style style, 536 Style style,
537 String inlineStyle 537 String inlineStyle
538 }) : super( 538 }) : super(
539 key: key, 539 key: key,
540 children: children, 540 children: children,
541 style: style, 541 style: style,
542 inlineStyle: inlineStyle 542 inlineStyle: inlineStyle
543 ); 543 );
544 } 544 }
545 545
546 class FlexContainer extends SkyElementWrapper {
547
548 RenderCSSFlex _root;
549 RenderCSSFlex _createNode() => new RenderCSSFlex(this, this.direction);
550
551 static final FlexContainer _emptyContainer = new FlexContainer();
552 // direction doesn't matter if it's empty
553
554 SkyNodeWrapper get _emptyNode => _emptyContainer;
555
556 final FlexDirection direction;
557
558 FlexContainer({
559 Object key,
560 List<UINode> children,
561 Style style,
562 String inlineStyle,
563 this.direction: FlexDirection.Row
564 }) : super(
565 key: key,
566 children: children,
567 style: style,
568 inlineStyle: inlineStyle
569 );
570
571 void _syncNode(UINode old) {
572 super._syncNode(old);
573 _root.direction = direction;
574 }
575 }
576
546 class Image extends SkyElementWrapper { 577 class Image extends SkyElementWrapper {
547 578
548 RenderCSSImage _root; 579 RenderCSSImage _root;
549 RenderCSSImage _createNode() => new RenderCSSImage(this, this.src, this.width, this.height); 580 RenderCSSImage _createNode() => new RenderCSSImage(this, this.src, this.width, this.height);
550 581
551 static final Image _emptyImage = new Image(); 582 static final Image _emptyImage = new Image();
552 583
553 SkyNodeWrapper get _emptyNode => _emptyImage; 584 SkyNodeWrapper get _emptyNode => _emptyImage;
554 585
555 final String src; 586 final String src;
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after
797 } 828 }
798 829
799 void _buildIfDirty() { 830 void _buildIfDirty() {
800 if (!_dirty || _defunct) 831 if (!_dirty || _defunct)
801 return; 832 return;
802 833
803 _trace('$_key rebuilding...'); 834 _trace('$_key rebuilding...');
804 _sync(null, _host, _root); 835 _sync(null, _host, _root);
805 } 836 }
806 } 837 }
OLDNEW
« no previous file with comments | « sky/framework/components/action_bar.dart ('k') | sky/framework/layout.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698