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

Side by Side Diff: sky/sdk/lib/theme/theme_data.dart

Issue 1192773004: Teach Sky buttons and dialogs how to use the new Theme system (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 unified diff | Download patch
« no previous file with comments | « no previous file | sky/sdk/lib/widgets/dialog.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 'dart:sky'; 5 import 'dart:sky';
6 6
7 import 'typography.dart' as typography; 7 import 'typography.dart' as typography;
8 import 'colors.dart' as colors; 8 import 'colors.dart' as colors;
9 9
10 enum ThemeBrightness { dark, light }
11
10 class ThemeData { 12 class ThemeData {
11 13
12 ThemeData.light({ 14 ThemeData.light({
13 this.primary, 15 this.primary,
14 this.accent, 16 this.accent,
15 bool darkToolbar: false }) 17 bool darkToolbar: false })
16 : toolbarText = darkToolbar ? typography.white : typography.black, 18 : brightness = ThemeBrightness.light,
17 text = typography.black, 19 toolbarText = darkToolbar ? typography.white : typography.black,
18 backgroundColor = colors.Grey[50], 20 text = typography.black;
19 dialogColor = colors.White;
20 21
21 ThemeData.dark({ this.primary, this.accent }) 22 ThemeData.dark({ this.primary, this.accent })
22 : toolbarText = typography.white, 23 : brightness = ThemeBrightness.dark,
23 text = typography.white, 24 toolbarText = typography.white,
24 backgroundColor = colors.Grey[850], 25 text = typography.white;
25 dialogColor = colors.Grey[800];
26 26
27 ThemeData.fallback() 27 ThemeData.fallback()
28 : primary = colors.Indigo, 28 : brightness = ThemeBrightness.light,
29 primary = colors.Indigo,
29 accent = colors.PinkAccent, 30 accent = colors.PinkAccent,
30 toolbarText = typography.white, 31 toolbarText = typography.white,
31 text = typography.black, 32 text = typography.black;
32 backgroundColor = colors.Grey[50],
33 dialogColor = colors.White;
34 33
34 final ThemeBrightness brightness;
35 final Map<int, Color> primary; 35 final Map<int, Color> primary;
36 final Map<int, Color> accent; 36 final Map<int, Color> accent;
37 final typography.TextTheme text; 37 final typography.TextTheme text;
38 final typography.TextTheme toolbarText; 38 final typography.TextTheme toolbarText;
39 final Color backgroundColor;
40 final Color dialogColor;
41 } 39 }
OLDNEW
« no previous file with comments | « no previous file | sky/sdk/lib/widgets/dialog.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698