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

Unified Diff: sky/sdk/lib/widgets/menu_item.dart

Issue 1217573003: Fix all the components to pick the right colours from the theme. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: 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/widgets/drawer_header.dart ('k') | sky/sdk/lib/widgets/popup_menu_item.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/sdk/lib/widgets/menu_item.dart
diff --git a/sky/sdk/lib/widgets/menu_item.dart b/sky/sdk/lib/widgets/menu_item.dart
index 26ea9092b46642026e04ae82f6c27de3c08c38a0..6f24377116f353f6d111ecf6e801741a7029f1dd 100644
--- a/sky/sdk/lib/widgets/menu_item.dart
+++ b/sky/sdk/lib/widgets/menu_item.dart
@@ -2,10 +2,13 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+import '../painting/text_style.dart';
import 'basic.dart';
import 'button_base.dart';
+import 'default_text_style.dart';
import 'icon.dart';
import 'ink_well.dart';
+import 'theme.dart';
import 'widget.dart';
const BoxDecoration _kHighlightDecoration = const BoxDecoration(
@@ -37,6 +40,13 @@ class MenuItem extends ButtonBase {
super.syncFields(source);
}
+ TextStyle get textStyle {
+ TextStyle result = Theme.of(this).text.body2;
+ if (highlight)
+ result = result.copyWith(color: Theme.of(this).primary[500]);
+ return result;
+ }
+
Widget buildContent() {
return new Listener(
onGestureTap: (_) {
@@ -53,10 +63,12 @@ class MenuItem extends ButtonBase {
child: new Icon(type: "${icon}_grey600", size: 24)
),
new Flexible(
- flex: 1,
child: new Padding(
padding: const EdgeDims.symmetric(horizontal: 16.0),
- child: new Flex(children, direction: FlexDirection.horizontal)
+ child: new DefaultTextStyle(
+ style: textStyle,
+ child: new Flex(children, direction: FlexDirection.horizontal)
+ )
)
)
])
« no previous file with comments | « sky/sdk/lib/widgets/drawer_header.dart ('k') | sky/sdk/lib/widgets/popup_menu_item.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698