Skip to content

Commit

Permalink
Upload an icon to preview in the action bar
Browse files Browse the repository at this point in the history
  • Loading branch information
makovkastar committed Jul 17, 2014
1 parent e3f1419 commit bd14571
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion src/html/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,7 @@ <h3>
'res/actionbar-preview/' + theme + '-' + type + '/' + 'mask_tab_hairline.png');
previewList['mask-ab-main-textured' + '-' + theme + '-' + type] = (
'res/actionbar-preview/' + theme + '-' + type + '/' + 'mask_ab_main_textured.png');
previewList['logo'] = ('res/actionbar-preview/logo.png');
}
}

Expand Down Expand Up @@ -865,6 +866,21 @@ <h3>
imagelib.drawing.copy(outCtx, tmpCtxAccent, iconSize);
imagelib.drawing.copy(outCtx, tmpCtxPressed, iconSize);
imagelib.drawing.copy(outCtx, PREVIEW_RESOURCES['fore' + foreEffect + '-' + coreTheme + '-' + abStyle], iconSize);

var logoSrc = values['logo'].ctx ? values['logo'].ctx : PREVIEW_RESOURCES['logo'];
var sourceRectLogo = {
x: 0,
y: 0,
w: logoSrc.canvas ? logoSrc.canvas.width : 48,
h: logoSrc.canvas ? logoSrc.canvas.height : 48
};
var targetRectLogo = {
x: 19,
y: 51,
w: 48,
h: 48
};
imagelib.drawing.drawCenterInside(outCtx, logoSrc, targetRectLogo, sourceRectLogo);

imagelib.loadFromUri(outCtx.canvas.toDataURL(), function(backgroundShape) {

This comment has been minimized.

Copy link
@camaleonluis
return function(img) {
Expand Down Expand Up @@ -979,7 +995,13 @@ <h3>
helpText: 'Contextual action bar highlight.',
defaultValue: DEFAULT_COLORS_LIGHT['cabHighlightColor']
}),

new studio.forms.ImageField('logo', {
title: 'Action bar logo',
helpText: 'Logo to display in the "home" section of the action bar.',
imageOnly: true,
noTrimForm: true,
noPreview: true
}),
]
});
form.createUI($('#inputs-form').get(0));
Expand Down
Binary file modified src/res/actionbar-preview/dark-solid/fore2.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 modified src/res/actionbar-preview/dark-transparent/fore2.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 modified src/res/actionbar-preview/light-solid/fore1.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 modified src/res/actionbar-preview/light-solid/fore2.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 modified src/res/actionbar-preview/light-transparent/fore2.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 src/res/actionbar-preview/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit bd14571

Please sign in to comment.