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

Side by Side Diff: sky/framework/components/drawer.dart

Issue 1128103009: [Effen] Start removing 'position'. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 7 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 | « no previous file | sky/framework/fn.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 'animated_component.dart'; 5 import 'animated_component.dart';
6 import '../animation/animated_value.dart'; 6 import '../animation/animated_value.dart';
7 import '../animation/curves.dart'; 7 import '../animation/curves.dart';
8 import '../fn.dart'; 8 import '../fn.dart';
9 import '../theme/colors.dart'; 9 import '../theme/colors.dart';
10 import 'dart:math' as math; 10 import 'dart:math' as math;
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 } 90 }
91 91
92 class Drawer extends AnimatedComponent { 92 class Drawer extends AnimatedComponent {
93 // TODO(abarth): We need a better way to become a container for absolutely 93 // TODO(abarth): We need a better way to become a container for absolutely
94 // positioned elements. 94 // positioned elements.
95 static final Style _style = new Style(''' 95 static final Style _style = new Style('''
96 transform: translateX(0);'''); 96 transform: translateX(0);''');
97 97
98 static final Style _maskStyle = new Style(''' 98 static final Style _maskStyle = new Style('''
99 background-color: black; 99 background-color: black;
100 will-change: opacity; 100 will-change: opacity;'''
101 position: absolute;
102 top: 0;
103 left: 0;
104 bottom: 0;
105 right: 0;'''
106 ); 101 );
107 102
108 static final Style _contentStyle = new Style(''' 103 static final Style _contentStyle = new Style('''
109 background-color: ${Grey[50]}; 104 background-color: ${Grey[50]};
110 will-change: transform; 105 will-change: transform;
111 position: absolute; 106 width: ${_kWidth}px;'''
112 width: ${_kWidth}px;
113 top: 0;
114 left: 0;
115 bottom: 0;'''
116 ); 107 );
117 108
118 List<UINode> children; 109 List<UINode> children;
119 int level; 110 int level;
120 DrawerController controller; 111 DrawerController controller;
121 112
122 double _position; 113 double _position;
123 114
124 Drawer({ 115 Drawer({
125 Object key, 116 Object key,
(...skipping 19 matching lines...) Expand all
145 136
146 Material content = new Material( 137 Material content = new Material(
147 content: new Container( 138 content: new Container(
148 style: _contentStyle, 139 style: _contentStyle,
149 inlineStyle: contentInlineStyle, 140 inlineStyle: contentInlineStyle,
150 children: children 141 children: children
151 ), 142 ),
152 level: level); 143 level: level);
153 144
154 return new EventListenerNode( 145 return new EventListenerNode(
155 new Container( 146 new FillStackContainer(
156 style: _style, 147 style: _style,
157 children: [ mask, content ] 148 children: [ mask, content ]
158 ), 149 ),
159 onPointerDown: controller.handlePointerDown, 150 onPointerDown: controller.handlePointerDown,
160 onPointerMove: controller.handlePointerMove, 151 onPointerMove: controller.handlePointerMove,
161 onPointerUp: controller.handlePointerUp, 152 onPointerUp: controller.handlePointerUp,
162 onPointerCancel: controller.handlePointerCancel 153 onPointerCancel: controller.handlePointerCancel
163 ); 154 );
164 } 155 }
165 } 156 }
OLDNEW
« no previous file with comments | « no previous file | sky/framework/fn.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698