OLD | NEW |
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:async'; | 5 import 'dart:async'; |
6 import 'dart:math' as math; | 6 import 'dart:math' as math; |
7 import 'dart:sky' as sky; | 7 import 'dart:sky' as sky; |
8 | 8 |
9 import '../animation/animated_value.dart'; | 9 import '../animation/animated_value.dart'; |
10 import '../painting/box_painter.dart'; | 10 import '../painting/box_painter.dart'; |
11 import '../theme/colors.dart'; | 11 import '../theme/colors.dart'; |
12 import '../theme/shadows.dart'; | 12 import '../theme/shadows.dart'; |
13 import 'animated_component.dart'; | 13 import 'animated_component.dart'; |
14 import 'basic.dart'; | 14 import 'basic.dart'; |
15 import 'popup_menu_item.dart'; | 15 import 'popup_menu_item.dart'; |
| 16 import 'scrollable_viewport.dart'; |
16 | 17 |
17 const double _kMenuOpenDuration = 300.0; | 18 const double _kMenuOpenDuration = 300.0; |
18 const double _kMenuCloseDuration = 200.0; | 19 const double _kMenuCloseDuration = 200.0; |
19 const double _kMenuCloseDelay = 100.0; | 20 const double _kMenuCloseDelay = 100.0; |
20 const double _kMenuWidthStep = 56.0; | 21 const double _kMenuWidthStep = 56.0; |
21 const double _kMenuMargin = 16.0; // 24.0 on tablet | 22 const double _kMenuMargin = 16.0; // 24.0 on tablet |
22 const double _kMenuMinWidth = 2.0 * _kMenuWidthStep; | 23 const double _kMenuMinWidth = 2.0 * _kMenuWidthStep; |
23 const double _kMenuMaxWidth = 5.0 * _kMenuWidthStep; | 24 const double _kMenuMaxWidth = 5.0 * _kMenuWidthStep; |
24 const double _kMenuHorizontalPadding = 16.0; | 25 const double _kMenuHorizontalPadding = 16.0; |
25 const double _kMenuVerticalPadding = 8.0; | 26 const double _kMenuVerticalPadding = 8.0; |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 minWidth: _kMenuMinWidth, | 116 minWidth: _kMenuMinWidth, |
116 maxWidth: _kMenuMaxWidth | 117 maxWidth: _kMenuMaxWidth |
117 ), | 118 ), |
118 child: new ShrinkWrapWidth( | 119 child: new ShrinkWrapWidth( |
119 stepWidth: _kMenuWidthStep, | 120 stepWidth: _kMenuWidthStep, |
120 child: new Container( | 121 child: new Container( |
121 padding: const EdgeDims.symmetric( | 122 padding: const EdgeDims.symmetric( |
122 horizontal: _kMenuHorizontalPadding, | 123 horizontal: _kMenuHorizontalPadding, |
123 vertical: _kMenuVerticalPadding | 124 vertical: _kMenuVerticalPadding |
124 ), | 125 ), |
125 child: new Block(children) | 126 child: new ScrollableViewport( |
| 127 child: new Block(children) |
| 128 ) |
126 ) | 129 ) |
127 ) | 130 ) |
128 ) | 131 ) |
129 ) | 132 ) |
130 ) | 133 ) |
131 ); | 134 ); |
132 } | 135 } |
133 | 136 |
134 } | 137 } |
OLD | NEW |