On OS X the "Cancel" is always get selected when dialog is cancelled
This commit is contained in:
parent
fb537d91fc
commit
df4b5f4ede
1 changed files with 7 additions and 0 deletions
|
@ -93,6 +93,7 @@ module.exports =
|
|||
options.detail ?= ''
|
||||
options.icon ?= null
|
||||
|
||||
# Choose a default button to get selected when dialog is cancelled.
|
||||
unless options.cancelId?
|
||||
options.cancelId = 0
|
||||
for text, i in options.buttons
|
||||
|
@ -100,6 +101,12 @@ module.exports =
|
|||
options.cancelId = i
|
||||
break
|
||||
|
||||
# On OS X the "Cancel" is always get selected when dialog is cancelled.
|
||||
if process.platform is 'darwin'
|
||||
for text, i in options.buttons when text is 'Cancel'
|
||||
options.cancelId = i
|
||||
break
|
||||
|
||||
binding.showMessageBox messageBoxType,
|
||||
options.buttons,
|
||||
options.cancelId,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue