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

Unified 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: it works! 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 side-by-side diff with in-line comments
Download patch
« sky/framework/fn.dart ('K') | « sky/framework/fn.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/framework/layouts/block.dart
diff --git a/sky/framework/layouts/block.dart b/sky/framework/layouts/block.dart
new file mode 100644
index 0000000000000000000000000000000000000000..33f464d7f2dd4887bcbb76fd61b51d4cc1624a97
--- /dev/null
+++ b/sky/framework/layouts/block.dart
@@ -0,0 +1,30 @@
+
+import 'dart:sky' as sky;
+import '../fn.dart';
+
+class BlockLayout extends LayoutContainer {
+
ojan 2015/04/13 21:49:27 ditto
+ BlockLayout({
+ Object key,
+ List<UINode> children,
+ Style style,
+ String inlineStyle
+ }) : super(
+ key: key,
+ children: children,
+ style: style,
+ inlineStyle: inlineStyle
+ );
+
+ void layout(sky.Element skyNode) {
+ double y = 0.0;
+ skyNode.width = skyNode.parentNode.width;
+ skyNode.getChildNodes().forEach((child) {
+ child.layout();
+ child.x = 0.0;
+ child.y = y;
+ y += child.height;
+ });
+ skyNode.height = y;
+ }
+}
« sky/framework/fn.dart ('K') | « sky/framework/fn.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698