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

Unified Diff: sky/sdk/lib/widgets/dialog.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sky/sdk/lib/theme/theme_data.dart ('k') | sky/sdk/lib/widgets/flat_button.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/sdk/lib/widgets/dialog.dart
diff --git a/sky/sdk/lib/widgets/dialog.dart b/sky/sdk/lib/widgets/dialog.dart
index 0f4c0d0de0626e2dba602c0e0c024616f5294fb7..027cd0cb0e669da6f6fd80a81e07e4755823d80d 100644
--- a/sky/sdk/lib/widgets/dialog.dart
+++ b/sky/sdk/lib/widgets/dialog.dart
@@ -2,8 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+import '../theme/colors.dart' as colors;
import 'basic.dart';
import 'material.dart';
+import "theme.dart";
class Dialog extends Component {
Dialog({
@@ -19,6 +21,15 @@ class Dialog extends Component {
final Widget actions;
final Function onDismiss;
+ Color get color {
+ switch (Theme.of(this).brightness) {
+ case ThemeBrightness.light:
+ return colors.White;
+ case ThemeBrightness.dark:
+ return colors.Grey[800];
+ }
+ }
+
Widget build() {
Container mask = new Container(
decoration: const BoxDecoration(
@@ -45,6 +56,7 @@ class Dialog extends Component {
constraints: new BoxConstraints(minWidth: 280.0),
child: new Material(
level: 4,
+ color: color,
child: new ShrinkWrapWidth(
child: new Block(children)
)
« no previous file with comments | « sky/sdk/lib/theme/theme_data.dart ('k') | sky/sdk/lib/widgets/flat_button.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698