definite-d / Themera

PySimpleGUI theme code generator.
GNU Lesser General Public License v3.0
28 stars 9 forks source link

[Suggestion] Swap locations for "Confirm" and "Cancel" buttons + defaults #6

Closed PySimpleGUI closed 4 years ago

PySimpleGUI commented 4 years ago

Disclaimer / apology

It drives me crazy when people send me code changes. It just does. I don't take pull requests. I personally don't want code sent to me. 🙄 So, I apologize for hacking at your code and sending you the changes. Maybe you've got a different attitude about these things. 😀

The industry standard for GUIs seems to be that when 2 buttons are shown, the left one is the "positive" or "Yes" choice and the right is the "negative" or "No" or "Cancel" choice.

This window has the locations swapped and I find myself getting confused as a result or cancelling because I assume the normal order applies.

The result after my hack looks like this: image

You may also want to bind the return key to the confirm button so that the user can simply press the return key rather than clicking confirm.

The line of code I changed is this:

  [sg.Button('Confirm', key='Confirm', tooltip='Let\'s begin.', bind_return_key=True), sg.Button('Cancel', key='Cancel', tooltip='Have it your way.')]

Now I can choose one and press return. Because I'm so obsessed with your groundbreaking colors from image feature, I've also made that the default radio button. The default currently is that none of them are selected. By defaulting, I don't have to click anything, I simply press return when I get to that window (I'm super lazy)

The code change that set the default was:

                        [sg.Radio('Get colors from an image.', default=True, key='Image', tooltip='Introducing... ImagePalette!', group_id='unspec_opts_choices')]
definite-d commented 4 years ago

Thanks for your observation. I will effect this change.

Ah, by the way, thanks for showing me how to make a radio button the default. Also, is there any way to make a checkbox enabled on default?

definite-d commented 4 years ago

This has been implemented, and will be included in the next upload. So, I'm closing this issue.