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

Unified Diff: sky/sdk/lib/widgets/basic.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/rendering/stack.dart ('k') | sky/sdk/lib/widgets/popup_menu.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/sdk/lib/widgets/basic.dart
diff --git a/sky/sdk/lib/widgets/basic.dart b/sky/sdk/lib/widgets/basic.dart
index cfbbdf8a764af7f100d3cf6e3e11dded49d8a3a8..f1a66e3887bd0ceda9b55e8f482f9b759a3ba7ef 100644
--- a/sky/sdk/lib/widgets/basic.dart
+++ b/sky/sdk/lib/widgets/basic.dart
@@ -254,6 +254,30 @@ class ShrinkWrapWidth extends OneChildRenderObjectWrapper {
}
+class Baseline extends OneChildRenderObjectWrapper {
+
+ Baseline({
+ String key,
+ this.baseline, // in pixels
+ this.baselineType: TextBaseline.alphabetic,
+ Widget child
+ }): super(key: key, child: child);
+
+ RenderBaseline get root => super.root;
+
+ final double baseline;
+ final TextBaseline baselineType;
+
+ RenderBaseline createNode() => new RenderBaseline(baseline: baseline, baselineType: baselineType);
+
+ void syncRenderObject(Baseline old) {
+ super.syncRenderObject(old);
+ root.baseline = baseline;
+ root.baselineType = baselineType;
+ }
+
+}
+
class SizeObserver extends OneChildRenderObjectWrapper {
SizeObserver({ String key, this.callback, Widget child })
« no previous file with comments | « sky/sdk/lib/rendering/stack.dart ('k') | sky/sdk/lib/widgets/popup_menu.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698