New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support normalizing access keys in dialog buttons #8308

Merged
merged 3 commits into from Jan 6, 2017

Conversation

Projects
None yet
3 participants
@kevinsawicki
Contributor

kevinsawicki commented Dec 29, 2016

This pull requests adds a new option to dialog.showMessageBox API called normalizeAccessKeys that, when true, 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:

Button Text macOS Windows Linux
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

@damieng

This comment has been minimized.

Show comment
Hide comment
@damieng

damieng Dec 30, 2016

This looks great, thanks!

damieng commented Dec 30, 2016

This looks great, thanks!

@Thetzleoo

This comment has been minimized.

Show comment
Hide comment

142,385

@kevinsawicki kevinsawicki merged commit 0a7dccb into master Jan 6, 2017

8 of 9 checks passed

continuous-integration/travis-ci/pr The Travis CI build is in progress
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
electron-linux-arm Build #5112721 succeeded in 94s
Details
electron-linux-ia32 Build #5112722 succeeded in 87s
Details
electron-linux-x64 Build #5112723 succeeded in 156s
Details
electron-mas-x64 Build #3113 succeeded in 8 min 49 sec
Details
electron-osx-x64 Build #3127 succeeded in 9 min 28 sec
Details
electron-win-ia32 Build #2161 succeeded in 13 min
Details
electron-win-x64 Build #2148 succeeded in 13 min
Details

@kevinsawicki kevinsawicki deleted the normalize-access-keys branch Jan 6, 2017

@kevinsawicki kevinsawicki referenced this pull request Jan 10, 2017

Merged

Upgrade Electron to v1.6.x #12696

14 of 17 tasks complete

@damieng damieng referenced this pull request Jan 26, 2017

Closed

Changed File Close Dialogue not usable with keyboard #2928

3 of 4 tasks complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment