Support normalizing access keys in dialog buttons #8308
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull requests adds a new option to
dialog.showMessageBox
API callednormalizeAccessKeys
that, whentrue
, will convert all the button labels to have the correct special character access keys on each platform.This option is off by default to not break existing apps. It could be switched to
true
by default in 2.0.&
is used as the default access key since that is the Window standard. That value is then converted to_
on Linux since that is the GTK convention.&&
can be used for escaped values.Access keys are removed when on macOS since there isn't support for them there.
Below is a table of the normalized values when this option is specified:
Hello
Hello
Hello
Hello
He&llo
Hello
He&llo
He_llo
Contact R&&D
Contact R&D
Contact R&&D
Contact R&D
Contact R&&&D
Contact R&D
Contact R&&&D
Contact R&_D
Contact R&&&&D
Contact R&&D
Contact R&&&&D
Contact R&&D
Chee&rs ^_^
Cheers ^_^
Chee&rs ^_^
Chee_rs ^__^
/cc @damieng just want to confirm with you this looks good for Atom's use cases.
Closes #7517