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

Unified Diff: sky/sdk/lib/framework/widgets/radio.dart

Issue 1177383006: Rename all the things (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: fix imports 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/widgets/radio.dart
diff --git a/sky/sdk/lib/framework/widgets/radio.dart b/sky/sdk/lib/framework/widgets/radio.dart
deleted file mode 100644
index 40f9c508481c6d21903e1dc3f40e98632e79f6f1..0000000000000000000000000000000000000000
--- a/sky/sdk/lib/framework/widgets/radio.dart
+++ /dev/null
@@ -1,72 +0,0 @@
-// Copyright 2015 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-import 'dart:sky' as sky;
-
-import 'package:sky/framework/theme2/colors.dart' as colors;
-
-import '../rendering/object.dart';
-import 'button_base.dart';
-import 'basic.dart';
-
-typedef void ValueChanged(value);
-
-class Radio extends ButtonBase {
-
- Radio({
- Object key,
- this.value,
- this.groupValue,
- this.onChanged
- }) : super(key: key);
-
- Object value;
- Object groupValue;
- ValueChanged onChanged;
-
- void syncFields(Radio source) {
- value = source.value;
- groupValue = source.groupValue;
- onChanged = source.onChanged;
- super.syncFields(source);
- }
-
- UINode buildContent() {
- // TODO(jackson): This should change colors with the theme
- Color color = highlight ? colors.Purple[500] : const Color(0x8A000000);
- const double kDiameter = 16.0;
- const double kOuterRadius = kDiameter / 2;
- const double kInnerRadius = 5.0;
- return new EventListenerNode(
- new Container(
- margin: const EdgeDims.symmetric(horizontal: 5.0),
- width: kDiameter,
- height: kDiameter,
- child: new CustomPaint(
- callback: (sky.Canvas canvas, Size size) {
-
- Paint paint = new Paint()..color = color;
-
- // Draw the outer circle
- paint.setStyle(sky.PaintingStyle.stroke);
- paint.strokeWidth = 2.0;
- canvas.drawCircle(kOuterRadius, kOuterRadius, kOuterRadius, paint);
-
- // Draw the inner circle
- if (value == groupValue) {
- paint.setStyle(sky.PaintingStyle.fill);
- canvas.drawCircle(kOuterRadius, kOuterRadius, kInnerRadius, paint);
- }
- }
- )
- ),
- onGestureTap: _handleClick
- );
- }
-
- void _handleClick(_) {
- onChanged(value);
- }
-
-}
« no previous file with comments | « sky/sdk/lib/framework/widgets/popup_menu_item.dart ('k') | sky/sdk/lib/framework/widgets/raised_button.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698