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

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

Issue 1235443002: Support for icon theming (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: fix tests Created 5 years, 5 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/widgets/icon.dart ('k') | sky/sdk/lib/widgets/menu_item.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/sdk/lib/widgets/icon_theme.dart
diff --git a/sky/sdk/lib/widgets/icon_theme.dart b/sky/sdk/lib/widgets/icon_theme.dart
new file mode 100644
index 0000000000000000000000000000000000000000..2cb084c281a3a10d82cc517d3a02e847eb06e5c4
--- /dev/null
+++ b/sky/sdk/lib/widgets/icon_theme.dart
@@ -0,0 +1,35 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
Hixie 2015/07/09 23:06:08 Put this in icon.dart, since only icons, and peopl
jackson 2015/07/09 23:16:19 Done.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+import 'basic.dart';
+import 'widget.dart';
+
+enum IconThemeColor { white, black }
+
+class IconThemeData {
+ const IconThemeData({ this.color });
+ final IconThemeColor color;
+}
+
+class IconTheme extends Inherited {
+
+ IconTheme({
+ String key,
+ this.data,
+ Widget child
+ }) : super(key: key, child: child) {
+ assert(data != null);
+ assert(child != null);
+ }
+
+ final IconThemeData data;
+
+ static IconThemeData of(Component component) {
+ IconTheme result = component.inheritedOfType(IconTheme);
+ return result == null ? null : result.data;
+ }
+
+ bool syncShouldNotify(IconTheme old) => data != old.data;
+
+}
« no previous file with comments | « sky/sdk/lib/widgets/icon.dart ('k') | sky/sdk/lib/widgets/menu_item.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698