提交 80786656 编写于 作者: E Eric Seidel

Make the Icon component use Image

Even though Image doesn't yet know how to handle
relative urls.

TBR=jackson@google.com

Review URL: https://codereview.chromium.org/1157163009
上级 7552bf79
......@@ -10,7 +10,7 @@ import '../rendering/box.dart';
const String kAssetBase = '/packages/sky/assets/material-design-icons';
class Icon extends Component {
int size;
double size;
String type;
Icon({
......@@ -27,12 +27,9 @@ class Icon extends Component {
category = parts[0];
subtype = parts[1];
}
// TODO(jackson): Use a real image.
return new Container(
desiredSize: new sky.Size(size.toDouble(), size.toDouble()),
decoration: new BoxDecoration(backgroundColor: const sky.Color(0xFFFF0000))
return new Image(
size: new sky.Size(size, size),
src: '${kAssetBase}/${category}/2x_web/ic_${subtype}_${size}dp.png'
);
// return new Image(width: size, height: size,
// src: '${kAssetBase}/${category}/2x_web/ic_${subtype}_${size}dp.png');
}
}
......@@ -16,7 +16,7 @@ class IconButton extends Component {
UINode build() {
return new EventListenerNode(
new Padding(
child: new Icon(type: icon, size: 24),
child: new Icon(type: icon, size: 24.0),
padding: const EdgeDims.all(8.0)),
onGestureTap: onGestureTap);
}
......
......@@ -44,7 +44,7 @@ class MenuItem extends ButtonBase {
children: [
new StyleNode(
new Icon(
size: 24,
size: 24.0,
type: "${icon}_grey600"
),
_iconStyle
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册