mirror of
https://github.com/piskelapp/piskel.git
synced 2023-08-10 21:12:52 +03:00
Add keyboard shortcuts 1 to 9 to quickly select palette colors
This commit is contained in:
@ -40,6 +40,7 @@
|
||||
|
||||
pskl.app.shortcutService.addShortcuts(['>', 'shift+>'], this.selectNextColor_.bind(this));
|
||||
pskl.app.shortcutService.addShortcut('<', this.selectPreviousColor_.bind(this));
|
||||
pskl.app.shortcutService.addShortcuts('123465789'.split(''), this.selectColorForKey_.bind(this));
|
||||
|
||||
this.fillPaletteList();
|
||||
this.updateFromUserSettings();
|
||||
@ -118,6 +119,12 @@
|
||||
return currentIndex;
|
||||
};
|
||||
|
||||
ns.PalettesListController.prototype.selectColorForKey_ = function (key) {
|
||||
var index = parseInt(key, 10);
|
||||
index = (index + 9) % 10;
|
||||
this.selectColor_(index);
|
||||
};
|
||||
|
||||
ns.PalettesListController.prototype.selectColor_ = function (index) {
|
||||
var colors = this.getSelectedPaletteColors_();
|
||||
var color = colors[index];
|
||||
|
Reference in New Issue
Block a user