Skip to content

Commit

Permalink
Merge pull request #26 from flbraun/hotkey-setting
Browse files Browse the repository at this point in the history
Make palette shortcut configurable in config file
  • Loading branch information
flbraun authored Nov 2, 2023
2 parents 34fe701 + 803ca7c commit d7a299c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ app.whenReady().then(() => {
})

// register shortcuts
const shortcut = 'CommandOrControl+P'
const shortcut = userSettings.get('paletteShortcut')
const ret = globalShortcut.register(shortcut, () => toggleWindowVisibility(window))
if (!ret) {
panic(window, `Failed to register shortcut: ${shortcut}`)
Expand Down
2 changes: 2 additions & 0 deletions src/main/storage.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const userSettingsSchema = {
type: 'string',
enum: ['challenge', 'challengehc', 'standard', 'hardcore'],
},
paletteShortcut: { type: 'string' },
}

const userSettings = new Store({ userSettingsSchema })
Expand All @@ -27,6 +28,7 @@ setdefault(userSettings, 'tradeEnabled', true)
setdefault(userSettings, 'tftEnabled', false)
setdefault(userSettings, 'toolsEnabled', true)
setdefault(userSettings, 'league', 'challenge')
setdefault(userSettings, 'paletteShortcut', 'CommandOrControl+P')
userSettings.getEnabledResultTypes = () => {
const enabled = []
if (userSettings.get('wikiEnabled')) enabled.push('wiki')
Expand Down

0 comments on commit d7a299c

Please sign in to comment.