8000 Support normalizing access keys in dialog buttons by kevinsawicki · Pull Request #8308 · electron/electron · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Support normalizing access keys in dialog buttons #8308

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

Merged
merged 3 commits into from
Jan 6, 2017

Conversation

kevinsawicki
Copy link
Contributor
@kevinsawicki 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
Copy link
damieng commented Dec 30, 2016

This looks great, thanks!

@Thetzleoo
Copy link

142,385

@kevinsawicki kevinsawicki force-pushed the normalize-access-keys branch from e5d2f9b to 584910c Compare January 6, 2017 16:56
@kevinsawicki kevinsawicki force-pushed the normalize-access-keys branch from 584910c to 5f862ef Compare January 6, 2017 17:17
@kevinsawicki kevinsawicki merged commit 0a7dccb into master Jan 6, 2017
@kevinsawicki kevinsawicki deleted the normalize-access-keys branch January 6, 2017 17:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0