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

Unified Diff: sky/sdk/lib/widgets/checkbox.dart

Issue 1194743003: Add a new Theme widget to control color and text color of apps (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: rebase 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
« no previous file with comments | « sky/sdk/lib/theme/typography.dart ('k') | sky/sdk/lib/widgets/scaffold.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/sdk/lib/widgets/checkbox.dart
diff --git a/sky/sdk/lib/widgets/checkbox.dart b/sky/sdk/lib/widgets/checkbox.dart
index 60fe090b4b0b616502384f1e57a1a2bad4666e79..489740463bc3e802471b89a4accd6c774c4c9970 100644
--- a/sky/sdk/lib/widgets/checkbox.dart
+++ b/sky/sdk/lib/widgets/checkbox.dart
@@ -4,7 +4,7 @@
import 'dart:sky' as sky;
-import 'package:sky/theme/colors.dart' as colors;
+import 'package:sky/widgets/theme.dart';
import 'basic.dart';
import 'toggleable.dart';
@@ -12,8 +12,6 @@ export 'toggleable.dart' show ValueChanged;
const double _kMidpoint = 0.5;
const sky.Color _kUncheckedColor = const sky.Color(0x8A000000);
-// TODO(jackson): This should change colors with the theme
-sky.Color _kCheckedColor = colors.Purple[500];
const double _kEdgeSize = 20.0;
const double _kEdgeRadius = 1.0;
@@ -59,10 +57,11 @@ class Checkbox extends Toggleable {
// Solid filled rrect
paint.setStyle(sky.PaintingStyle.strokeAndFill);
+ Color themeColor = Theme.of(this).color[500];
paint.color = new Color.fromARGB((t * 255).floor(),
- _kCheckedColor.red,
- _kCheckedColor.green,
- _kCheckedColor.blue);
+ themeColor.red,
+ themeColor.green,
+ themeColor.blue);
canvas.drawRRect(rrect, paint);
// White inner check
« no previous file with comments | « sky/sdk/lib/theme/typography.dart ('k') | sky/sdk/lib/widgets/scaffold.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698