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

Unified Diff: sky/sdk/lib/framework/components2/scaffold.dart

Issue 1161983004: Refactor layout/relayout into a single method. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sky/sdk/lib/framework/app.dart ('k') | sky/sdk/lib/framework/fn2.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/sdk/lib/framework/components2/scaffold.dart
diff --git a/sky/sdk/lib/framework/components2/scaffold.dart b/sky/sdk/lib/framework/components2/scaffold.dart
index 0df15ea822bd15f15225a65e930db22ebbc7b29c..fd654fe7e526da002ce2efd7f755d1ab27556284 100644
--- a/sky/sdk/lib/framework/components2/scaffold.dart
+++ b/sky/sdk/lib/framework/components2/scaffold.dart
@@ -79,12 +79,12 @@ class RenderScaffold extends RenderDecoratedBox {
markNeedsLayout();
}
- void layout(BoxConstraints constraints, { RenderNode relayoutSubtreeRoot }) {
+ bool get sizedByParent => true;
+ void performResize() {
width = constraints.constrainWidth(double.INFINITY);
assert(width < double.INFINITY);
height = constraints.constrainHeight(double.INFINITY);
assert(height < double.INFINITY);
- relayout();
}
static const kToolbarHeight = 100.0;
@@ -92,7 +92,7 @@ class RenderScaffold extends RenderDecoratedBox {
static const kButtonX = -16.0; // from right edge of body
static const kButtonY = -16.0; // from bottom edge of body
- void relayout() {
+ void performLayout() {
double bodyHeight = height;
double bodyPosition = 0.0;
if (toolbar != null) {
@@ -128,7 +128,6 @@ class RenderScaffold extends RenderDecoratedBox {
floatingActionButton.parentData.x = width - xButtonX;
floatingActionButton.parentData.y = bodyPosition + bodyHeight - kButtonY;
}
- layoutDone();
}
void paint(RenderNodeDisplayList canvas) {
« no previous file with comments | « sky/sdk/lib/framework/app.dart ('k') | sky/sdk/lib/framework/fn2.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698