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

Side by Side Diff: sky/sdk/lib/framework/components2/radio.dart

Issue 1166203002: Rename Container's desiredSize argument to width and height arguments. (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
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 'package:sky/framework/theme2/colors.dart' as colors; 5 import 'package:sky/framework/theme2/colors.dart' as colors;
6 6
7 import '../fn2.dart'; 7 import '../fn2.dart';
8 import '../rendering/object.dart'; 8 import '../rendering/object.dart';
9 import 'button_base.dart'; 9 import 'button_base.dart';
10 import 'ink_well.dart'; 10 import 'ink_well.dart';
(...skipping 15 matching lines...) Expand all
26 26
27 UINode buildContent() { 27 UINode buildContent() {
28 // TODO(jackson): This should change colors with the theme 28 // TODO(jackson): This should change colors with the theme
29 Color color = highlight ? colors.Purple[500] : const Color(0x8A000000); 29 Color color = highlight ? colors.Purple[500] : const Color(0x8A000000);
30 const double diameter = 16.0; 30 const double diameter = 16.0;
31 const double outerRadius = diameter / 2; 31 const double outerRadius = diameter / 2;
32 const double innerRadius = 5.0; 32 const double innerRadius = 5.0;
33 return new EventListenerNode( 33 return new EventListenerNode(
34 new Container( 34 new Container(
35 margin: const EdgeDims.symmetric(horizontal: 5.0), 35 margin: const EdgeDims.symmetric(horizontal: 5.0),
36 desiredSize: new Size(diameter, diameter), 36 width: diameter,
37 height: diameter,
37 child: new CustomPaint( 38 child: new CustomPaint(
38 callback: (sky.Canvas canvas) { 39 callback: (sky.Canvas canvas) {
39 40
40 Paint paint = new Paint()..color = color; 41 Paint paint = new Paint()..color = color;
41 42
42 // Draw the outer circle 43 // Draw the outer circle
43 paint.setStyle(sky.PaintingStyle.stroke); 44 paint.setStyle(sky.PaintingStyle.stroke);
44 paint.strokeWidth = 2.0; 45 paint.strokeWidth = 2.0;
45 canvas.drawCircle(outerRadius, outerRadius, outerRadius, paint); 46 canvas.drawCircle(outerRadius, outerRadius, outerRadius, paint);
46 47
47 // Draw the inner circle 48 // Draw the inner circle
48 if (value == groupValue) { 49 if (value == groupValue) {
49 paint.setStyle(sky.PaintingStyle.fill); 50 paint.setStyle(sky.PaintingStyle.fill);
50 canvas.drawCircle(outerRadius, outerRadius, innerRadius, paint); 51 canvas.drawCircle(outerRadius, outerRadius, innerRadius, paint);
51 } 52 }
52 } 53 }
53 ) 54 )
54 ), 55 ),
55 onGestureTap: _handleClick 56 onGestureTap: _handleClick
56 ); 57 );
57 } 58 }
58 59
59 void _handleClick(_) { 60 void _handleClick(_) {
60 onChanged(value); 61 onChanged(value);
61 } 62 }
62 } 63 }
OLDNEW
« no previous file with comments | « sky/sdk/lib/framework/components2/menu_item.dart ('k') | sky/sdk/lib/framework/components2/scaffold.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698