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

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

Issue 1171173003: Right-size the toolbar (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Toolbar contents bottom-justfied, stretch past notification area 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
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 9ed7ba1ddb929201a08871010aa8275d9c21307a..fb4d5241363116d8e24a512148b87ef3c325b509 100644
--- a/sky/sdk/lib/framework/components2/scaffold.dart
+++ b/sky/sdk/lib/framework/components2/scaffold.dart
@@ -5,6 +5,7 @@
import '../fn2.dart';
import '../rendering/box.dart';
import '../rendering/object.dart';
+import '../theme2/view_configuration.dart';
enum ScaffoldSlots {
toolbar,
@@ -78,8 +79,6 @@ class RenderScaffold extends RenderBox {
assert(size.height < double.INFINITY);
}
- static const kToolbarHeight = 100.0;
- static const kStatusbarHeight = 50.0;
static const kButtonX = 16.0; // left from right edge of body
static const kButtonY = 16.0; // up from bottom edge of body
@@ -88,11 +87,12 @@ class RenderScaffold extends RenderBox {
double bodyPosition = 0.0;
if (_slots[ScaffoldSlots.toolbar] != null) {
RenderBox toolbar = _slots[ScaffoldSlots.toolbar];
- toolbar.layout(new BoxConstraints.tight(new Size(size.width, kToolbarHeight)));
+ var toolbarHeight = kToolBarHeight + kNotificationAreaHeight;
Hixie 2015/06/10 17:57:13 double, not var.
hansmuller 2015/06/10 18:06:24 Done.
+ toolbar.layout(new BoxConstraints.tight(new Size(size.width, toolbarHeight)));
assert(toolbar.parentData is BoxParentData);
- toolbar.parentData.position = Point.origin;
- bodyPosition = kToolbarHeight;
- bodyHeight -= kToolbarHeight;
+ toolbar.parentData.position = new Point(0.0, bodyPosition);
Hixie 2015/06/10 17:57:13 Go back to Point.origin, unless there's reason to
hansmuller 2015/06/10 18:06:24 Done.
+ bodyPosition += toolbarHeight;
+ bodyHeight -= toolbarHeight;
}
if (_slots[ScaffoldSlots.statusBar] != null) {
RenderBox statusbar = _slots[ScaffoldSlots.statusBar];
« no previous file with comments | « no previous file | sky/sdk/lib/framework/components2/tool_bar.dart » ('j') | sky/sdk/lib/framework/components2/tool_bar.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698