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

Unified Diff: sky/sdk/lib/theme/theme_data.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
Index: sky/sdk/lib/theme/theme_data.dart
diff --git a/sky/sdk/lib/theme/theme_data.dart b/sky/sdk/lib/theme/theme_data.dart
index be7652afaba4b15c77df09a3d9f1ad05b4a32d2e..b80188350ef1086588234bf7f0b6e372d37ba70f 100644
--- a/sky/sdk/lib/theme/theme_data.dart
+++ b/sky/sdk/lib/theme/theme_data.dart
@@ -15,11 +15,11 @@ class ThemeData {
ThemeBrightness brightness,
Map<int, Color> primarySwatch,
Color accentColor,
- Color floatingActionButtonColor,
- typography.TextTheme text,
- typography.TextTheme toolbarText })
+ this.accentColorBrightness: ThemeBrightness.dark,
+ typography.TextTheme text })
: this.brightness = brightness,
this.primarySwatch = primarySwatch,
+ primaryColorBrightness = primarySwatch == null ? brightness : ThemeBrightness.dark,
canvasColor = brightness == ThemeBrightness.dark ? colors.Grey[850] : colors.Grey[50],
cardColor = brightness == ThemeBrightness.dark ? colors.Grey[800] : colors.White,
dividerColor = brightness == ThemeBrightness.dark ? const Color(0x1FFFFFFF) : const Color(0x1F000000),
@@ -27,31 +27,20 @@ class ThemeData {
assert(brightness != null);
if (primarySwatch == null) {
- _primaryColor = brightness == ThemeBrightness.dark ? colors.Grey[900] : colors.Grey[100];
+ if (brightness == ThemeBrightness.dark) {
+ _primaryColor = colors.Grey[900];
+ } else {
+ _primaryColor = colors.Grey[100];
+ }
} else {
_primaryColor = primarySwatch[500];
}
-
+
if (accentColor == null) {
_accentColor = primarySwatch == null ? colors.Blue[500] : primarySwatch[500];
} else {
_accentColor = accentColor;
}
-
- if (floatingActionButtonColor == null) {
- _floatingActionButtonColor = accentColor == null ? colors.PinkAccent[200] : accentColor;
- } else {
- _floatingActionButtonColor = floatingActionButtonColor;
- }
-
- if (toolbarText == null) {
- if (colors.DarkColors.contains(primarySwatch) || _primaryColor == colors.Grey[900])
- _toolbarText = typography.white;
- else
- _toolbarText = typography.black;
- } else {
- _toolbarText = toolbarText;
- }
}
factory ThemeData.light() => new ThemeData(primarySwatch: colors.Blue, brightness: ThemeBrightness.light);
@@ -63,17 +52,16 @@ class ThemeData {
final Color canvasColor;
final Color cardColor;
final Color dividerColor;
+ final String iconSuffix;
final typography.TextTheme text;
Color _primaryColor;
Color get primaryColor => _primaryColor;
+ final ThemeBrightness primaryColorBrightness;
+
Color _accentColor;
Color get accentColor => _accentColor;
- Color _floatingActionButtonColor;
- Color get floatingActionButtonColor => _floatingActionButtonColor;
-
- typography.TextTheme _toolbarText;
- typography.TextTheme get toolbarText => _toolbarText;
+ final ThemeBrightness accentColorBrightness;
}

Powered by Google App Engine
This is Rietveld 408576698