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

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

Issue 1219113003: Make popup menus line up to their baseline per the Material spec. (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/popup_menu.dart ('k') | sky/specs/style-guide.md » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/sdk/lib/widgets/popup_menu_item.dart
diff --git a/sky/sdk/lib/widgets/popup_menu_item.dart b/sky/sdk/lib/widgets/popup_menu_item.dart
index 17147cd10a8afccc2fa7c769e1744ac1b1e5c24b..c87dc0d5ca9dd4fbe450e23db5c46ab0bb018d3e 100644
--- a/sky/sdk/lib/widgets/popup_menu_item.dart
+++ b/sky/sdk/lib/widgets/popup_menu_item.dart
@@ -8,6 +8,9 @@ import 'default_text_style.dart';
import 'ink_well.dart';
import 'theme.dart';
+const double kMenuItemHeight = 48.0;
+const double kBaselineOffsetFromBottom = 20.0;
+
class PopupMenuItem extends Component {
PopupMenuItem({ String key, this.child, this.opacity}) : super(key: key);
@@ -21,10 +24,13 @@ class PopupMenuItem extends Component {
opacity: opacity,
child: new InkWell(
child: new Container(
- height: 48.0,
+ height: kMenuItemHeight,
child: new DefaultTextStyle(
style: textStyle,
- child: child
+ child: new Baseline(
+ baseline: kMenuItemHeight - kBaselineOffsetFromBottom,
+ child: child
+ )
)
)
)
« no previous file with comments | « sky/sdk/lib/widgets/popup_menu.dart ('k') | sky/specs/style-guide.md » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698