Skip to content

Commit

Permalink
Updated path to unavailable image thumbnail.
Browse files Browse the repository at this point in the history
  • Loading branch information
reimund committed Jun 30, 2014
1 parent 42eb25a commit 132bcb2
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 28 deletions.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
53 changes: 25 additions & 28 deletions scripts/Tych Panel/Tych Panel Only/ImageItem.jsx
@@ -1,53 +1,56 @@
var placeholder = new File(app.path + '/Plug-ins/Panels/Tych Panel/content/Tych Panel.assets/media/img/thumbnail-unavailable.png');
var placeholder = new File(app.path + '/Presets/Scripts/Tych Panel/Images/thumbnail-unavailable.png');

/*
* Image list item constructor. Creates the objects needed to present an image
* with a label and border.
*/
var ImageItem = function(container, file, index, thumbnail)
{
var border = container.add('group');
var border = container.add('group');
border.margins = 1;
setBackgroundColor(border, [0.8, 0.8, 0.8]);

var item_container = border.add('group');
var item_container = border.add('group');
item_container.orientation = 'column';
item_container.onClick = clickItem;
item_container.item = this;
item_container.onClick = clickItem;
item_container.item = this;

var image;

try {
try
{
if (thumbnail != undefined)
image = item_container.add('Image', [0, 0, 256, 256], thumbnail);
else
image = item_container.add('Image', [0, 0, 256, 256], file);
} catch (err) {
}
catch (err)
{
image = item_container.add('Image', [0, 0, 256, 256], placeholder);
}

image.onClick = clickItem;

var label_container = item_container.add('group');
label_container.margins = [0, 8, 0, 0];
var label_container = item_container.add('group');
label_container.margins = [0, 8, 0, 0];
label_container.orientation = 'column';
label_container.size = [200, 30];
label_container.onClick = clickItem;

this.file = file;
this.container = container;
this.border = border;
this.image = image;
this.item_container = item_container;
this.label = label_container.add('statictext', undefined, file.name);
label_container.size = [200, 30];
label_container.onClick = clickItem;

this.file = file;
this.container = container;
this.border = border;
this.image = image;
this.item_container = item_container;
this.label = label_container.add('statictext', undefined, file.name);
this.label_container = label_container;
this.label.onClick = clickItem;
this.index = index;
this.thumbnail = thumbnail;
this.label.onClick = clickItem;
this.index = index;
this.thumbnail = thumbnail;

this.deselect();
}


/*
* Sets the image of the image item.
*/
Expand All @@ -59,7 +62,6 @@ ImageItem.prototype.setImage = function(file) { this.image.image = file; }
*/
ImageItem.prototype.setLabel = function(text) { this.label.text = text; }


/*
* Selects the image item, making it light blue.
*/
Expand All @@ -70,7 +72,6 @@ ImageItem.prototype.select = function()
this.selected = true;
}


/*
* Deselects the image item, making it white.
*/
Expand All @@ -81,7 +82,6 @@ ImageItem.prototype.deselect = function()
this.selected = false;
}


/*
* Toggles the selection of the image item.
*/
Expand All @@ -93,7 +93,6 @@ ImageItem.prototype.toggleSelection = function()
this.deselect();
}


/*
* Draws image within its bounding box.
* Written by Marc Autret.
Expand All @@ -115,7 +114,6 @@ Image.prototype.onDraw = function()
WH = wh = xy = null;
}


/*
* Sets the background color of the specified element.
*/
Expand All @@ -125,7 +123,6 @@ function setBackgroundColor(element, color)
gfx.backgroundColor = gfx.newBrush(gfx.BrushType.SOLID_COLOR, color);
}


/*
* Click handler for image items.
*/
Expand Down

0 comments on commit 132bcb2

Please sign in to comment.