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

Unified Diff: sky/sdk/lib/painting/text_style.dart

Issue 1204523002: Material light and dark themes for Sky widgets (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: support accent colors 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
Index: sky/sdk/lib/painting/text_style.dart
diff --git a/sky/sdk/lib/painting/text_style.dart b/sky/sdk/lib/painting/text_style.dart
index 19d3c547e0447c9560d92de91ce36220cb91490f..cf8a7422e936b1ef02746941c1e302a9001d4b56 100644
--- a/sky/sdk/lib/painting/text_style.dart
+++ b/sky/sdk/lib/painting/text_style.dart
@@ -74,6 +74,7 @@ class TextStyle {
TextStyle copyWith({
Color color,
+ String fontFamily,
double fontSize,
FontWeight fontWeight,
TextAlign textAlign,
@@ -97,6 +98,19 @@ class TextStyle {
return 'rgba(${color.red}, ${color.green}, ${color.blue}, ${color.alpha / 255.0})';
}
+ TextStyle merge(TextStyle other) {
+ return copyWith(
+ color: other.color,
+ fontFamily: other.fontFamily,
+ fontSize: other.fontSize,
+ fontWeight: other.fontWeight,
+ textAlign: other.textAlign,
+ decoration: other.decoration,
+ decorationColor: other.decorationColor,
+ decorationStyle: other.decorationStyle
+ );
+ }
+
static String _fontFamilyToCSSString(String fontFamily) {
// TODO(hansmuller): escape the fontFamily string.
return fontFamily;

Powered by Google App Engine
This is Rietveld 408576698