Skip to content

Commit

Permalink
feat: Support custom accelerators for default menu items
Browse files Browse the repository at this point in the history
  • Loading branch information
ygshbht committed Aug 23, 2023
1 parent a388241 commit 6e74a48
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,11 @@ const create = (win, options) => {
if (options.labels && options.labels[menuItem.id]) {
menuItem.label = options.labels[menuItem.id];
}

// Apply custom accelerators for default menu items
if (options.accelerators && options.accelerators[menuItem.id]) {
menuItem.accelerator = options.accelerators[menuItem.id];
}

// Replace placeholders in menu item labels
if (typeof menuItem.label === 'string' && menuItem.label.includes('{selection}')) {
Expand Down

0 comments on commit 6e74a48

Please sign in to comment.