Commit 179712c7 authored by neil.fraser@gmail.com's avatar neil.fraser@gmail.com Committed by carlospamg

Merge trashcan body, dropdown checkmark, and tree arrows into one sprite.

git-svn-id: http://blockly.googlecode.com/svn/trunk@1747 c400ca83-b69d-9dd7-9705-49c6b8615e23
parent d22c0d8a
This diff is collapsed.
......@@ -310,7 +310,7 @@ Blockly.Css.CONTENT = [
/* Override the default Closure URL. */
'.blocklyWidgetDiv .goog-option-selected .goog-menuitem-checkbox,',
'.blocklyWidgetDiv .goog-option-selected .goog-menuitem-icon {',
' background: url(<<<PATH>>>/media/sprites.png) no-repeat 0 0 !important;',
' background: url(<<<PATH>>>/media/sprites.png) no-repeat -48px -16px !important;',
'}',
/* Category tree in Toolbox. */
......@@ -350,7 +350,7 @@ Blockly.Css.CONTENT = [
' height: 16px;',
' width: 16px;',
' vertical-align: middle;',
' background-image: url(<<<PATH>>>/media/tree.png);',
' background-image: url(<<<PATH>>>/media/sprites.png);',
'}',
'.blocklyTreeIconClosedLtr {',
......@@ -365,10 +365,6 @@ Blockly.Css.CONTENT = [
' background-position: -16px -1px;',
'}',
'.blocklyTreeIconNone {',
' background-position: -48px -1px;',
'}',
'.blocklyTreeSelected>.blocklyTreeIconClosedLtr {',
' background-position: -32px -17px;',
'}',
......@@ -381,8 +377,9 @@ Blockly.Css.CONTENT = [
' background-position: -16px -17px;',
'}',
'.blocklyTreeIconNone,',
'.blocklyTreeSelected>.blocklyTreeIconNone {',
' background-position: -48px -17px;',
' background-position: -48px -1px;',
'}',
'.blocklyTreeLabel {',
......
......@@ -39,11 +39,11 @@ Blockly.Trashcan = function(workspace) {
};
/**
* URL of the trashcan image (minus lid).
* URL of the sprite image.
* @type {string}
* @private
*/
Blockly.Trashcan.prototype.BODY_URL_ = 'media/trashbody.png';
Blockly.Trashcan.prototype.SPRITE_URL_ = 'media/sprites.png';
/**
* URL of the lid image.
......@@ -107,13 +107,6 @@ Blockly.Trashcan.prototype.isOpen = false;
*/
Blockly.Trashcan.prototype.svgGroup_ = null;
/**
* The SVG image element of the trash can body.
* @type {Element}
* @private
*/
Blockly.Trashcan.prototype.svgBody_ = null;
/**
* The SVG image element of the trash can lid.
* @type {Element}
......@@ -156,23 +149,36 @@ Blockly.Trashcan.prototype.top_ = 0;
Blockly.Trashcan.prototype.createDom = function() {
/*
<g filter="url(#blocklyTrashcanShadowFilter)">
<image width="47" height="45" y="15" href="media/trashbody.png"></image>
<clippath id="blocklyTrashBodyClipPath">
<rect width="47" height="45" y="15"></rect>
</clippath>
<image width="64" height="92" y="15" href="media/trashbody.png"
clip-path="url(#blocklyTrashBodyClipPath)"></image>
<image width="47" height="15" href="media/trashlid.png"></image>
</g>
*/
this.svgGroup_ = Blockly.createSvgElement('g',
{'filter': 'url(#blocklyTrashcanShadowFilter)'}, null);
this.svgBody_ = Blockly.createSvgElement('image',
{'width': this.WIDTH_, 'height': this.BODY_HEIGHT_},
var clip = Blockly.createSvgElement('clipPath',
{'id': 'blocklyTrashBodyClipPath'},
this.svgGroup_);
Blockly.createSvgElement('rect',
{'width': 47, 'height': 45, 'y': 15},
clip);
var body = Blockly.createSvgElement('image',
{'width': 64, 'height': 92, 'y': -32,
'clip-path': 'url(#blocklyTrashBodyClipPath)'},
this.svgGroup_);
this.svgBody_.setAttributeNS('http://www.w3.org/1999/xlink', 'xlink:href',
Blockly.pathToBlockly + this.BODY_URL_);
this.svgBody_.setAttribute('y', this.LID_HEIGHT_);
body.setAttributeNS('http://www.w3.org/1999/xlink', 'xlink:href',
Blockly.pathToBlockly + this.SPRITE_URL_);
this.svgLid_ = Blockly.createSvgElement('image',
{'width': this.WIDTH_, 'height': this.LID_HEIGHT_},
this.svgGroup_);
this.svgLid_.setAttributeNS('http://www.w3.org/1999/xlink', 'xlink:href',
Blockly.pathToBlockly + this.LID_URL_);
return this.svgGroup_;
};
......@@ -195,7 +201,6 @@ Blockly.Trashcan.prototype.dispose = function() {
goog.dom.removeNode(this.svgGroup_);
this.svgGroup_ = null;
}
this.svgBody_ = null;
this.svgLid_ = null;
this.workspace_ = null;
goog.Timer.clear(this.lidTask_);
......
media/sprites.png

887 Bytes | W: | H:

media/sprites.png

4.35 KB | W: | H:

media/sprites.png
media/sprites.png
media/sprites.png
media/sprites.png
  • 2-up
  • Swipe
  • Onion skin
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment