arduino-ide
arduino-ide copied to clipboard
Dialog focus
Motivation
Some dialogs, when being opened, don't set the focus on the controls (inputs, button, etc)
Change description
Fixed the focus in the following dialogs:
- Configure and Upload
- Firmware Uploader
- Certificate Uploader
Also changed "Configure And Upload" label to "Configure and Upload".
Other information
Fixes #1373
Reviewer checklist
- [ ] PR addresses a single concern.
- [ ] The PR has no duplicates (please search among the Pull Requests before creating one)
- [ ] PR title and description are properly filled.
- [ ] Docs have been added / updated (for bug fixes / features)
@kittaakos Thank you for spotting it. Please try it again, it should work correctly now.
It does not work for me. Once the focus is removed, IDE2 does not put back the focus back to the on dialog open.
You're right, it works only the first time. I've fixed it now, thanks for spotting it!
@kittaakos those borders are bold because the focus goes on them when the dialog shows up. #1373 only mentions the user fields dialog, but I wanted to solve the issue more broadly. Thanks for the review!
but I wanted to solve the issue more broadly.
Can you explain why did you decide to set the focus on the buttons only in these two dialogs and not on the others?
Can you explain why did you decide to set the focus on the buttons only in these two dialogs and not on the others?
My reasoning was to try to set the focus on the most appropriate UI element in the dialog. Of course, the definition of most appropriate is arbitrary, so I did what I thought it was best.
Here's the reasoning I've applied on each dialog:
- the user fields one needs to have the focus on the first input element because when the user opens it, the will need to fill them in in order to upload
- with the firmware updater one, the first action the user would like to take is to press the button (if a board is found) because a board is automatically selected
- when the user opens the SSL root certificate one, it's usually not possible to click on the UPLOAD button because if you don't add a certificate before it will be disabled, so I've set the focus on the first button
So, generally I guess my rationale was to set the focus on the UI element that lets the user do what they want to do with a dialog as quickly as possible.
Of course, all of this is questionable, so if you have suggestions or if you disagree with these decisions, please let me know!
So, generally I guess my rationale was to set the focus on the UI element that lets the user do what they want to do with a dialog as quickly as possible.
Thank you for writing down the explanation.