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

Unified Diff: sky/sdk/lib/framework/fn2.dart

Issue 1155683011: Add |constraints| to Container for PopupMenuItem (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 6 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
« no previous file with comments | « sky/sdk/lib/framework/components2/popup_menu_item.dart ('k') | sky/sdk/lib/framework/rendering/box.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/sdk/lib/framework/fn2.dart
diff --git a/sky/sdk/lib/framework/fn2.dart b/sky/sdk/lib/framework/fn2.dart
index ac53ccdcb58c21c8080d61be665c8fc82ceb7e2e..b960a5646904977463b623f80101f888ba5fd44f 100644
--- a/sky/sdk/lib/framework/fn2.dart
+++ b/sky/sdk/lib/framework/fn2.dart
@@ -18,7 +18,7 @@ import 'rendering/object.dart';
import 'rendering/paragraph.dart';
import 'rendering/stack.dart';
export 'rendering/object.dart' show Point, Size, Rect, Color, Paint, Path;
-export 'rendering/box.dart' show BoxDecoration, Border, BorderSide, EdgeDims;
+export 'rendering/box.dart' show BoxConstraints, BoxDecoration, Border, BorderSide, EdgeDims;
export 'rendering/flex.dart' show FlexDirection;
// final sky.Tracing _tracing = sky.window.tracing;
@@ -418,6 +418,21 @@ class SizedBox extends OneChildRenderObjectWrapper {
}
}
+class ConstrainedBox extends OneChildRenderObjectWrapper {
+ RenderConstrainedBox root;
+ final BoxConstraints constraints;
+
+ ConstrainedBox({ this.constraints, UINode child, Object key })
+ : super(child: child, key: key);
+
+ RenderConstrainedBox createNode() => new RenderConstrainedBox(additionalConstraints: constraints);
+
+ void syncRenderObject(ConstrainedBox old) {
+ super.syncRenderObject(old);
+ root.additionalConstraints = constraints;
+ }
+}
+
class Transform extends OneChildRenderObjectWrapper {
RenderTransform root;
final Matrix4 transform;
@@ -932,20 +947,22 @@ abstract class Component extends UINode {
class Container extends Component {
final UINode child;
- final Matrix4 transform;
- final EdgeDims margin;
+ final BoxConstraints constraints;
final BoxDecoration decoration;
- final Size desiredSize;
+ final EdgeDims margin;
final EdgeDims padding;
+ final Matrix4 transform;
+ final Size desiredSize;
Container({
Object key,
this.child,
- this.transform,
- this.margin,
+ this.constraints,
this.decoration,
this.desiredSize,
- this.padding
+ this.margin,
+ this.padding,
+ this.transform
}) : super(key: key);
UINode build() {
@@ -960,6 +977,9 @@ class Container extends Component {
if (desiredSize != null)
current = new SizedBox(desiredSize: desiredSize, child: current);
+ if (constraints != null)
+ current = new ConstrainedBox(constraints: constraints);
+
if (margin != null)
current = new Padding(padding: margin, child: current);
« no previous file with comments | « sky/sdk/lib/framework/components2/popup_menu_item.dart ('k') | sky/sdk/lib/framework/rendering/box.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698