| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 import '../fn2.dart'; | 5 import '../fn2.dart'; |
| 6 import '../layout2.dart'; | 6 import '../layout2.dart'; |
| 7 import '../theme/typography.dart' as typography; | 7 import '../theme/typography.dart' as typography; |
| 8 | 8 |
| 9 // RenderNode | 9 // RenderNode |
| 10 class RenderScaffold extends RenderDecoratedBox { | 10 class RenderScaffold extends RenderDecoratedBox { |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 if (toolbar != null) | 141 if (toolbar != null) |
| 142 canvas.paintChild(toolbar, (toolbar.parentData as BoxParentData).x, (toolb
ar.parentData as BoxParentData).y); | 142 canvas.paintChild(toolbar, (toolbar.parentData as BoxParentData).x, (toolb
ar.parentData as BoxParentData).y); |
| 143 if (floatingActionButton != null) | 143 if (floatingActionButton != null) |
| 144 canvas.paintChild(floatingActionButton, (floatingActionButton.parentData a
s BoxParentData).x, (floatingActionButton.parentData as BoxParentData).y); | 144 canvas.paintChild(floatingActionButton, (floatingActionButton.parentData a
s BoxParentData).x, (floatingActionButton.parentData as BoxParentData).y); |
| 145 if (drawer != null) | 145 if (drawer != null) |
| 146 canvas.paintChild(drawer, (drawer.parentData as BoxParentData).x, (drawer.
parentData as BoxParentData).y); | 146 canvas.paintChild(drawer, (drawer.parentData as BoxParentData).x, (drawer.
parentData as BoxParentData).y); |
| 147 } | 147 } |
| 148 | 148 |
| 149 void hitTestChildren(HitTestResult result, { double x, double y }) { | 149 void hitTestChildren(HitTestResult result, { double x, double y }) { |
| 150 assert(floatingActionButton == null || floatingActionButton.parentData is Bo
xParentData); | 150 assert(floatingActionButton == null || floatingActionButton.parentData is Bo
xParentData); |
| 151 assert(statusBar == null || statusBar.parentData is BoxParentData); | 151 assert(statusbar == null || statusbar.parentData is BoxParentData); |
| 152 if ((drawer != null) && (x < drawer.width)) { | 152 if ((drawer != null) && (x < drawer.width)) { |
| 153 drawer.hitTest(result, x: x, y: y); | 153 drawer.hitTest(result, x: x, y: y); |
| 154 } else if ((floatingActionButton != null) && (x >= floatingActionButton.pare
ntData.x) && (x < floatingActionButton.parentData.x + floatingActionButton.width
) | 154 } else if ((floatingActionButton != null) && (x >= floatingActionButton.pare
ntData.x) && (x < floatingActionButton.parentData.x + floatingActionButton.width
) |
| 155 && (y >= floatingActionButton.pare
ntData.y) && (y < floatingActionButton.parentData.y + floatingActionButton.heigh
t)) { | 155 && (y >= floatingActionButton.pare
ntData.y) && (y < floatingActionButton.parentData.y + floatingActionButton.heigh
t)) { |
| 156 floatingActionButton.hitTest(result, x: x-floatingActionButton.parentData.
x, y: y-floatingActionButton.parentData.y); | 156 floatingActionButton.hitTest(result, x: x-floatingActionButton.parentData.
x, y: y-floatingActionButton.parentData.y); |
| 157 } else if ((toolbar != null) && (y < toolbar.height)) { | 157 } else if ((toolbar != null) && (y < toolbar.height)) { |
| 158 toolbar.hitTest(result, x: x, y: y); | 158 toolbar.hitTest(result, x: x, y: y); |
| 159 } else if ((statusbar != null) && (y > statusbar.parentData.y)) { | 159 } else if ((statusbar != null) && (y > statusbar.parentData.y)) { |
| 160 statusbar.hitTest(result, x: x, y: y-statusbar.parentData.y); | 160 statusbar.hitTest(result, x: x, y: y-statusbar.parentData.y); |
| 161 } else { | 161 } else if (body != null) { |
| 162 body.hitTest(result, x: x, y: y-body.parentData.y); | 162 body.hitTest(result, x: x, y: y-body.parentData.y); |
| 163 } | 163 } |
| 164 } | 164 } |
| 165 | 165 |
| 166 } | 166 } |
| 167 | 167 |
| 168 class Scaffold extends RenderNodeWrapper { | 168 class Scaffold extends RenderNodeWrapper { |
| 169 | 169 |
| 170 // static final Style _style = new Style(''' | 170 // static final Style _style = new Style(''' |
| 171 // ${typography.typeface}; | 171 // ${typography.typeface}; |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 222 void syncRenderNode(UINode old) { | 222 void syncRenderNode(UINode old) { |
| 223 super.syncRenderNode(old); | 223 super.syncRenderNode(old); |
| 224 syncChild(toolbar, old is Scaffold ? old.toolbar : null, #toolbar); | 224 syncChild(toolbar, old is Scaffold ? old.toolbar : null, #toolbar); |
| 225 syncChild(body, old is Scaffold ? old.body : null, #body); | 225 syncChild(body, old is Scaffold ? old.body : null, #body); |
| 226 syncChild(statusbar, old is Scaffold ? old.statusbar : null, #statusbar); | 226 syncChild(statusbar, old is Scaffold ? old.statusbar : null, #statusbar); |
| 227 syncChild(drawer, old is Scaffold ? old.drawer : null, #drawer); | 227 syncChild(drawer, old is Scaffold ? old.drawer : null, #drawer); |
| 228 syncChild(floatingActionButton, old is Scaffold ? old.floatingActionButton :
null, #floatingActionButton); | 228 syncChild(floatingActionButton, old is Scaffold ? old.floatingActionButton :
null, #floatingActionButton); |
| 229 } | 229 } |
| 230 | 230 |
| 231 } | 231 } |
| OLD | NEW |