Skip to content
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

Change the highlighted button on each window #10497

Merged
merged 1 commit into from Mar 27, 2022

Conversation

martinD2014
Copy link
Contributor

As described in issue 11184, the first button on each pane, widget or window gets highlighted and selected. This is the default behaviour for QPushButtons in a QDialog. By setting the autoDefault to false for the buttons, the close or cancel button in the bottom becomes the default which is then highlighted. This makes more sense than highlighting the first random button. This also makes it so that when pressing enter, the window closes instead of performing whatever functionality the first button on a window has.

@MayImilae
Copy link
Contributor

Screenshots please~

@martinD2014
Copy link
Contributor Author

For example the controller settings where "configure" is selected by default:
image

versus when "close" is selected:
image

Or when in the GameCube controller settings the "refresh" is selected by default:
image

versus when "close" is selected:
image

@jordan-woyak
Copy link
Member

FYI, PR #7784 from a while back had a workaround that (depending on the dialog) might be cleaner than manually setting every single button in dolphin to not default.
Or alternatively maybe we should have a NonDefaultQPushButton derived class? Having to manually tell every button not to be the default is unfortunate.

@martinD2014
Copy link
Contributor Author

Okay, I will look into that, thank you. Should I in the meantime set this pull request to draft?

@martinD2014
Copy link
Contributor Author

So I made the NonDefaultQPushButton which sets the autoDefault option to false. This way it is no longer needed to specify this for every QPushButton, but you can just use the NonDefaultQPushButton. For the connect calls of the button, the normal QPushButton can still be used, so there is no need to change all those occurrences in the code.

@AdmiralCurtiss
Copy link
Contributor

You should probably squash those commits, but seems fine to me otherwise.

@AdmiralCurtiss AdmiralCurtiss merged commit b379df3 into dolphin-emu:master Mar 27, 2022
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
4 participants