Skip to content

Commit

Permalink
fixed icons for qtree
Browse files Browse the repository at this point in the history
  • Loading branch information
stevewirts committed Jun 22, 2015
1 parent 50961dd commit c531cbc
Show file tree
Hide file tree
Showing 8 changed files with 41 additions and 9 deletions.
24 changes: 20 additions & 4 deletions fin-hypergrid.dev.html
Original file line number Diff line number Diff line change
Expand Up @@ -18389,14 +18389,18 @@
isRowHovered = this.config.isRowHovered,
val = this.config.value;

var leftIcon, rightIcon, ixoffset, iyoffset;
var leftIcon, rightIcon, centerIcon, ixoffset, iyoffset;

//setting gc properties are expensive, lets not do it unnecessarily

if (val && val.constructor === Array) {
leftIcon = val[0];
rightIcon = val[2];
val = val[1];
if (typeof val === 'object') { // must be an image
centerIcon = val;
val = null;
}
}

if (gc.font !== this.config.font) {
Expand Down Expand Up @@ -18442,8 +18446,11 @@
gc.fillStyle = theColor;
gc.strokeStyle = theColor;
}
gc.fillText(val, x + halignOffset, y + valignOffset);
if (val) {
gc.fillText(val, x + halignOffset, y + valignOffset);
} else if (centerIcon) {

}
if (isColumnHovered && isRowHovered) {
gc.beginPath();
if (isLink) {
Expand All @@ -18466,6 +18473,12 @@
gc.drawImage(rightIcon, x + width - ixoffset - rightIcon.width, y + iyoffset);
iconWidth = Math.max(rightIcon.width + 2);
}
if (centerIcon) {
iyoffset = Math.round((height - rightIcon.height) / 2);
ixoffset = Math.round((width - centerIcon.width) / 2);
gc.drawImage(centerIcon, x + width - ixoffset - centerIcon.width, y + iyoffset);
iconWidth = Math.max(centerIcon.width + 2);
}
this.config.minWidth = this.config.minWidth + 2 * (iconWidth);
},

Expand Down Expand Up @@ -22731,6 +22744,8 @@
['expand-all', 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAOwgAADsIBFShKgAAAABh0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMC41ZYUyZQAAAQ9JREFUOE9jcIoq/Y+MgYCBFAw2AMahmQEK7UL/k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JKpur5T/EyWnkfHZ8mwpkhBYNpLhpkDIdAoDovMyIIw5envrs8eIcN90BsuNv+JxZor6dOHorWTPnKnmgxpO776HnBoYuJVS7e7ol1tW2O++JxsNiOvcTIkYlBNbp7w8seEtwzfImKhDjzUr8nMq14srtrtspOgqN9wa0YvcwzUuQAAAABJRU5ErkJggg=='],
['empty', 'iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAYdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuNWWFMmUAAAANSURBVBhXY/j//z8DAAj8Av6IXwbgAAAAAElFTkSuQmCC'],
['up-arrow', 'iVBORw0KGgoAAAANSUhEUgAAAAUAAAAKCAYAAAB8OZQwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAYdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuNWWFMmUAAAA9SURBVBhXbYvRCgAgCAOtqP//Y9tElw8NDrcDzd0DBCd7iSL3E0IvGOpf2fKXeZUFKDcYFMwBlDNWS76bXUM5P9In5AzyAAAAAElFTkSuQmCC'],
['down-arrow', 'iVBORw0KGgoAAAANSUhEUgAAAAUAAAAKCAYAAAB8OZQwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAYdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuNWWFMmUAAAA+SURBVBhXhYvRCgAgCAOtqP//4+WWhtBDB1duqBUQ/2W5LLtSMFyW020skuecwOGj6QzfkuExt1LlcqICgG3S7z/SL/jVpgAAAABJRU5ErkJggg==']
];
Expand Down Expand Up @@ -28030,9 +28045,10 @@
return clone;
} else {
if (this.isColumnReorderable()) {
return [this.getImage('collapse-all'), '®', this.getImage('expand-all')];
return [this.getImage('collapse-all'), this.getImage('reset'), this.getImage('expand-all')];
//return [this.getImage('collapse-all'), '®', this.getImage('expand-all')];
} else {
return '®';
return [this.getImage('empty'), this.getImage('reset'), this.getImage('empty')];
}
}
},
Expand Down
2 changes: 1 addition & 1 deletion fin-hypergrid.min.html

Large diffs are not rendered by default.

Binary file added images/empty.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/reset.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/reset.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions polymer/js/behaviors/fin-hypergrid-behavior-base.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ it contains all code/data that's necessary for easily implementing a virtual dat
['expand-all', 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAOwgAADsIBFShKgAAAABh0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMC41ZYUyZQAAAQ9JREFUOE9jcIoq/Y+MgYCBFAw2AMahmQEK7UL/kTGyHFFeAGkKOmoLxhgGIHNwYZCm0JMOYIzVACCAC2JzEUhTxFlnMCboAmRvIBsQc8kNjPG6AETjMiD+micYE+UCZAwSA2lKvuUDxnhdgIwLNqWDFcNw+n1/MEYWK9iYjqoJhGE2O8QU/FdplPsfesL+f9bjIBQMErOaqgtUjuYCEA1zNghbpyT815wgBbY570Xo/9znof/T7vn/V++X+N93sB2iB6YYhpENALFBCs2XqP0veB0OxiA2TDMIo2gGYZgXYBgkFrjQ7X/AAWsIXuAKFoNhFM34sN5Ehf8g/Pj9QyAXIY6iCB8GORvZ6RD8nwEA/ZSbmLCRhEoAAAAASUVORK5CYII='],
['collapse-all', 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQ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TkSuQmCC'],
['up-arrow', 'iVBORw0KGgoAAAANSUhEUgAAAAUAAAAKCAYAAAB8OZQwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAYdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuNWWFMmUAAAA9SURBVBhXbYvRCgAgCAOtqP//Y9tElw8NDrcDzd0DBCd7iSL3E0IvGOpf2fKXeZUFKDcYFMwBlDNWS76bXUM5P9In5AzyAAAAAElFTkSuQmCC'],
['down-arrow', 'iVBORw0KGgoAAAANSUhEUgAAAAUAAAAKCAYAAAB8OZQwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAYdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuNWWFMmUAAAA+SURBVBhXhYvRCgAgCAOtqP//4+WWhtBDB1duqBUQ/2W5LLtSMFyW020skuecwOGj6QzfkuExt1LlcqICgG3S7z/SL/jVpgAAAABJRU5ErkJggg==']
];
Expand Down
5 changes: 3 additions & 2 deletions polymer/js/behaviors/fin-hypergrid-behavior-qtree.js
Original file line number Diff line number Diff line change
Expand Up @@ -315,9 +315,10 @@
return clone;
} else {
if (this.isColumnReorderable()) {
return [this.getImage('collapse-all'), '®', this.getImage('expand-all')];
return [this.getImage('collapse-all'), this.getImage('reset'), this.getImage('expand-all')];
//return [this.getImage('collapse-all'), '®', this.getImage('expand-all')];
} else {
return '®';
return [this.getImage('empty'), this.getImage('reset'), this.getImage('empty')];
}
}
},
Expand Down
17 changes: 15 additions & 2 deletions polymer/js/fin-hypergrid-cell-provider.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,14 +142,18 @@ var noop = function() {};
isRowHovered = this.config.isRowHovered,
val = this.config.value;

var leftIcon, rightIcon, ixoffset, iyoffset;
var leftIcon, rightIcon, centerIcon, ixoffset, iyoffset;

//setting gc properties are expensive, lets not do it unnecessarily

if (val && val.constructor === Array) {
leftIcon = val[0];
rightIcon = val[2];
val = val[1];
if (typeof val === 'object') { // must be an image
centerIcon = val;
val = null;
}
}

if (gc.font !== this.config.font) {
Expand Down Expand Up @@ -195,8 +199,11 @@ var noop = function() {};
gc.fillStyle = theColor;
gc.strokeStyle = theColor;
}
gc.fillText(val, x + halignOffset, y + valignOffset);
if (val) {
gc.fillText(val, x + halignOffset, y + valignOffset);
} else if (centerIcon) {

}
if (isColumnHovered && isRowHovered) {
gc.beginPath();
if (isLink) {
Expand All @@ -219,6 +226,12 @@ var noop = function() {};
gc.drawImage(rightIcon, x + width - ixoffset - rightIcon.width, y + iyoffset);
iconWidth = Math.max(rightIcon.width + 2);
}
if (centerIcon) {
iyoffset = Math.round((height - rightIcon.height) / 2);
ixoffset = Math.round((width - centerIcon.width) / 2);
gc.drawImage(centerIcon, x + width - ixoffset - centerIcon.width, y + iyoffset);
iconWidth = Math.max(centerIcon.width + 2);
}
this.config.minWidth = this.config.minWidth + 2 * (iconWidth);
},

Expand Down

0 comments on commit c531cbc

Please sign in to comment.