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

Unified Diff: sky/framework/components/material.dart

Issue 1006053002: Allow Effen Styles to be extendable (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: sdfsd Created 5 years, 9 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/framework/components/input.dart ('k') | sky/framework/components/menu_divider.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/framework/components/material.dart
diff --git a/sky/framework/components/material.dart b/sky/framework/components/material.dart
index 1a58f06034e426c6ca98bf7d0b1e91053627f47d..8b6177938ce9dc920b2d6889208535ae1032d133 100644
--- a/sky/framework/components/material.dart
+++ b/sky/framework/components/material.dart
@@ -29,14 +29,14 @@ class Material extends Component {
LinkedHashSet<SplashAnimation> _splashes;
- List<Style> styles;
+ Style style;
String inlineStyle;
List<Node> children;
int level;
Material({
Object key,
- this.styles,
+ this.style,
this.inlineStyle,
this.children,
this.level: 0 }) : super(key: key) {
@@ -50,7 +50,7 @@ class Material extends Component {
if (_splashes != null) {
childrenIncludingSplashes.add(new Container(
- styles: [_splashesStyle],
+ style: _splashesStyle,
children: new List.from(_splashes.map(
(s) => new InkSplash(s.onStyleChanged))),
key: 'Splashes'
@@ -60,14 +60,12 @@ class Material extends Component {
if (children != null)
childrenIncludingSplashes.addAll(children);
- List<Style> stylesIncludingShadow = styles;
- if (level > 0) {
- stylesIncludingShadow = new List.from(styles);
- stylesIncludingShadow.add(shadowStyle[level]);
- }
-
- return new Container(key: 'Material', styles: stylesIncludingShadow,
- inlineStyle: inlineStyle, children: childrenIncludingSplashes);
+ return new Container(
+ key: 'Material',
+ style: level > 0 ? style.extend(shadowStyle[level]) : style,
+ inlineStyle: inlineStyle,
+ children: childrenIncludingSplashes
+ );
}
sky.ClientRect _getBoundingRect() => (getRoot() as sky.Element).getBoundingClientRect();
« no previous file with comments | « sky/framework/components/input.dart ('k') | sky/framework/components/menu_divider.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698