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

Side by Side Diff: sky/framework/layouts/block.dart

Issue 1064983002: [Effen] basic layout container class for custom layout (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 8 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/fn.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1
2 import 'dart:sky' as sky;
3 import '../fn.dart';
4
5 class BlockLayout extends LayoutContainer {
6
7 BlockLayout({
8 Object key,
9 List<UINode> children,
10 Style style,
11 String inlineStyle
12 }) : super(
13 key: key,
14 children: children,
15 style: style,
16 inlineStyle: inlineStyle
17 );
18
19 void layout(sky.Element skyNode) {
20 double y = 0.0;
ojan 2015/04/08 20:08:11 FYI, here you should be doing skyNode.width = skyN
Hixie 2015/04/09 16:26:39 why wouldn't the parent set the width?
21 skyNode.getChildElements().forEach((child) {
22 child.width = skyNode.width;
23 child.setNeedsLayout(); // with this line, sky crashes. without it, nothin g renders as a child of this LayoutContainer
24 child.layout();
25 child.x = 0.0;
26 child.y = y;
27 y += child.height;
28 });
29 skyNode.height = y;
30 }
31 }
OLDNEW
« no previous file with comments | « sky/framework/fn.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698