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

Use ui_text_submit instead of ui_accept to confirm and close text prompts #81189

Conversation

jsjtxietian
Copy link
Contributor

@jsjtxietian jsjtxietian commented Aug 31, 2023

Fixes #81161
ui_accept key map includes key Space, should use ui_text_submit.

@akien-mga akien-mga added this to the 4.2 milestone Aug 31, 2023
@akien-mga akien-mga requested a review from a team August 31, 2023 06:46
@Maran23
Copy link
Contributor

Maran23 commented Aug 31, 2023

Hmm, I think a better default for confirming a dialog would be the ENTER key. That is more in line what other UI framework and/or operating systems are doing,

So maybe we need another action, maybe we can use the ui_text_submit here?
image

This looks like the right action here IMO, since you accept a text inside the dialog.
If not, we need to think about a new action, something like ui_confirm, which also maps to ENTER and KP ENTER.

@jsjtxietian
Copy link
Contributor Author

Thank you for your feedback! I will change the code to use ui_text_submit, seems like the suitable one.

@jsjtxietian jsjtxietian force-pushed the Fix-press-space-when-enter-editor-layout-name-will-confirm-save branch from 1761545 to 0bc9f44 Compare August 31, 2023 07:51
@YuriSizov YuriSizov added the cherrypick:4.1 Considered for cherry-picking into a future 4.1.x release label Aug 31, 2023
@YuriSizov
Copy link
Contributor

YuriSizov commented Aug 31, 2023

Same change needs to be done to editor/plugins/theme_editor_plugin.cpp, another affected dialog from #77297.

Edit: Would be also good to amend the commit message. You can use my edit of the title, or a shorter version of it: "Use ui_text_submit to confirm and close text prompts"

@YuriSizov YuriSizov changed the title Fix press space key when enter editor layout name will confirm and save layout Use ui_text_submit instead of ui_accept to confirm and close text prompts Aug 31, 2023
Fix press space when enter editor layout name will
confirm and save layout, same in theme editor
@jsjtxietian jsjtxietian force-pushed the Fix-press-space-when-enter-editor-layout-name-will-confirm-save branch from 0bc9f44 to ba41910 Compare September 1, 2023 04:25
@akien-mga akien-mga merged commit 0703546 into godotengine:master Sep 2, 2023
15 checks passed
@akien-mga
Copy link
Member

Thanks!

@jsjtxietian jsjtxietian deleted the Fix-press-space-when-enter-editor-layout-name-will-confirm-save branch September 2, 2023 13:16
@YuriSizov YuriSizov removed the cherrypick:4.1 Considered for cherry-picking into a future 4.1.x release label Sep 21, 2023
@YuriSizov
Copy link
Contributor

Cherry-picked for 4.1.2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Pressing space when entering the name of an editor layout confirm the save dialog
4 participants