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

Side by Side Diff: sky/sdk/lib/widgets/fixed_height_scrollable.dart

Issue 1178723010: Make the popup menu work again. (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 unified diff | Download patch
« no previous file with comments | « sky/sdk/lib/widgets/drawer_header.dart ('k') | sky/sdk/lib/widgets/popup_menu.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 import 'dart:math' as math; 5 import 'dart:math' as math;
6 6
7 import 'package:vector_math/vector_math.dart'; 7 import 'package:vector_math/vector_math.dart';
8 8
9 import '../framework/animation/scroll_behavior.dart'; 9 import '../framework/animation/scroll_behavior.dart';
10 import 'basic.dart'; 10 import 'basic.dart';
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 if (alignmentDelta != 0.0) 61 if (alignmentDelta != 0.0)
62 alignmentDelta -= itemHeight; 62 alignmentDelta -= itemHeight;
63 63
64 double drawStart = scrollOffset + alignmentDelta; 64 double drawStart = scrollOffset + alignmentDelta;
65 itemShowIndex = math.max(0, (drawStart / itemHeight).floor()); 65 itemShowIndex = math.max(0, (drawStart / itemHeight).floor());
66 66
67 transform.translate(0.0, alignmentDelta); 67 transform.translate(0.0, alignmentDelta);
68 } 68 }
69 } 69 }
70 70
71 List<Widget> items = buildItems(itemShowIndex, itemShowCount);
72 assert(items.every((item) => item.key != null));
73
71 return new SizeObserver( 74 return new SizeObserver(
72 callback: _handleSizeChanged, 75 callback: _handleSizeChanged,
73 child: new ClipRect( 76 child: new ClipRect(
74 child: new Transform( 77 child: new Transform(
75 transform: transform, 78 transform: transform,
76 child: new Block(buildItems(itemShowIndex, itemShowCount)) 79 child: new Block(items)
77 ) 80 )
78 ) 81 )
79 ); 82 );
80 } 83 }
81 84
82 List<Widget> buildItems(int start, int count); 85 List<Widget> buildItems(int start, int count);
83 86
84 } 87 }
OLDNEW
« no previous file with comments | « sky/sdk/lib/widgets/drawer_header.dart ('k') | sky/sdk/lib/widgets/popup_menu.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698