Issue #287 : Shortcuts now rely on Shortcut instances. Shortcut key can be changed dynamically.

This commit is contained in:
jdescottes
2015-10-10 19:32:25 +02:00
parent 8081d5e232
commit ca3bbf1c57
35 changed files with 597 additions and 185 deletions

View File

@@ -5,6 +5,7 @@
ns.LayersListController = function (piskelController) {
this.piskelController = piskelController;
this.layerPreviewShortcut = pskl.service.keyboard.Shortcuts.MISC.LAYER_PREVIEW ;
};
ns.LayersListController.prototype.init = function () {
@@ -36,10 +37,9 @@
var descriptors = [{description : 'Opacity defined in PREFERENCES'}];
var helpText = 'Preview all layers';
var toggleLayerPreviewTooltip = pskl.utils.TooltipFormatter.format(helpText, TOGGLE_LAYER_SHORTCUT, descriptors);
this.toggleLayerPreviewEl.setAttribute('title', toggleLayerPreviewTooltip);
pskl.app.shortcutService.registerShortcut(TOGGLE_LAYER_SHORTCUT, this.toggleLayerPreview_.bind(this));
pskl.app.shortcutService.registerShortcut(this.layerPreviewShortcut, this.toggleLayerPreview_.bind(this));
var tooltip = pskl.utils.TooltipFormatter.format(helpText, this.layerPreviewShortcut, descriptors);
this.toggleLayerPreviewEl.setAttribute('title', tooltip);
};
ns.LayersListController.prototype.updateButtonStatus_ = function () {