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

Side by Side Diff: sky/examples/raw/simple_render_tree.dart

Issue 1153893006: Replace setBoxDecoration() with a decoration property. (Closed) Base URL: https://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 unified diff | Download patch
« no previous file with comments | « no previous file | sky/sdk/lib/framework/layout2.dart » ('j') | sky/sdk/lib/framework/layout2.dart » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 'dart:sky'; 5 import 'dart:sky';
6 import 'package:sky/framework/app.dart'; 6 import 'package:sky/framework/app.dart';
7 import 'package:sky/framework/layout2.dart'; 7 import 'package:sky/framework/layout2.dart';
8 8
9 class RenderSolidColor extends RenderDecoratedBox { 9 class RenderSolidColor extends RenderDecoratedBox {
10 final double desiredHeight; 10 final double desiredHeight;
(...skipping 12 matching lines...) Expand all
23 } 23 }
24 24
25 void layout(BoxConstraints constraints, { RenderNode relayoutSubtreeRoot }) { 25 void layout(BoxConstraints constraints, { RenderNode relayoutSubtreeRoot }) {
26 width = constraints.constrainWidth(desiredWidth); 26 width = constraints.constrainWidth(desiredWidth);
27 height = constraints.constrainHeight(desiredHeight); 27 height = constraints.constrainHeight(desiredHeight);
28 layoutDone(); 28 layoutDone();
29 } 29 }
30 30
31 void handlePointer(PointerEvent event) { 31 void handlePointer(PointerEvent event) {
32 if (event.type == 'pointerdown') 32 if (event.type == 'pointerdown')
33 setBoxDecoration(new BoxDecoration(backgroundColor: 0xFFFF0000)); 33 decoration = new BoxDecoration(backgroundColor: 0xFFFF0000);
34 else if (event.type == 'pointerup') 34 else if (event.type == 'pointerup')
35 setBoxDecoration(new BoxDecoration(backgroundColor: backgroundColor)); 35 decoration = new BoxDecoration(backgroundColor: backgroundColor);
36 } 36 }
37 } 37 }
38 38
39 AppView app; 39 AppView app;
40 40
41 void main() { 41 void main() {
42 var root = new RenderFlex( 42 var root = new RenderFlex(
43 direction: FlexDirection.Vertical, 43 direction: FlexDirection.Vertical,
44 decoration: new BoxDecoration(backgroundColor: 0xFF000000)); 44 decoration: new BoxDecoration(backgroundColor: 0xFF000000));
45 45
(...skipping 26 matching lines...) Expand all
72 // Purple and blue cells 72 // Purple and blue cells
73 addFlexChild(row, 0x77FF00FF, flex: 1); 73 addFlexChild(row, 0x77FF00FF, flex: 1);
74 addFlexChild(row, 0xFF0000FF, flex: 2); 74 addFlexChild(row, 0xFF0000FF, flex: 2);
75 75
76 root.add(row); 76 root.add(row);
77 row.parentData.flex = 3; 77 row.parentData.flex = 3;
78 78
79 app = new AppView(root); 79 app = new AppView(root);
80 80
81 } 81 }
OLDNEW
« no previous file with comments | « no previous file | sky/sdk/lib/framework/layout2.dart » ('j') | sky/sdk/lib/framework/layout2.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698