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