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

Unified Diff: sky/sdk/lib/framework/components2/menu_item.dart

Issue 1168323003: Make ink splashes work in MenuItem (Closed) Base URL: git@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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/sdk/lib/framework/components2/menu_item.dart
diff --git a/sky/sdk/lib/framework/components2/menu_item.dart b/sky/sdk/lib/framework/components2/menu_item.dart
index 77b42923ee415287ad38b2622173122b0677187b..b2f85ce38d1a80cde278018822c8e19fc76675c1 100644
--- a/sky/sdk/lib/framework/components2/menu_item.dart
+++ b/sky/sdk/lib/framework/components2/menu_item.dart
@@ -7,13 +7,22 @@ import 'button_base.dart';
import 'icon.dart';
import 'ink_well.dart';
-class MenuItem extends ButtonBase {
+const BoxDecoration _kHighlightDecoration = const BoxDecoration(
+ backgroundColor: const Color.fromARGB(102, 153, 153, 153)
+);
- MenuItem({ Object key, this.icon, this.children, this.onGestureTap }) : super(key: key);
+// TODO(abarth): We shouldn't need _kHighlightBoring, but currently Container
+// isn't smarth enough to retain the components it builds when we
+// add or remove a |decoration|. For now, we use a transparent
+// decoration to avoid changing the structure of the tree. The
+// right fix, however, is to make Container smarter about how it
+// syncs its subcomponents.
+const BoxDecoration _kHighlightBoring = const BoxDecoration(
+ backgroundColor: const Color.fromARGB(0, 0, 0, 0)
+);
- static const BoxDecoration highlightDecoration = const BoxDecoration(
- backgroundColor: const Color.fromARGB(102, 153, 153, 153)
- );
+class MenuItem extends ButtonBase {
+ MenuItem({ Object key, this.icon, this.children, this.onGestureTap }) : super(key: key);
List<UINode> children;
String icon;
@@ -41,10 +50,9 @@ class MenuItem extends ButtonBase {
]
),
height: 48.0,
- decoration: highlight ? highlightDecoration : null
+ decoration: highlight ? _kHighlightDecoration : _kHighlightBoring
),
onGestureTap: onGestureTap
);
}
-
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698