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

Allows SpinBox to drop focus when pressing Escape #7543

Closed
KoBeWi opened this issue Aug 22, 2023 · 0 comments · Fixed by godotengine/godot#81128
Closed

Allows SpinBox to drop focus when pressing Escape #7543

KoBeWi opened this issue Aug 22, 2023 · 0 comments · Fixed by godotengine/godot#81128
Milestone

Comments

@KoBeWi
Copy link
Member

KoBeWi commented Aug 22, 2023

Describe the project you are working on

Various GUI apps.

Describe the problem or limitation you are having in your project

I'm annoyed by SpinBoxes not being able to easily lose focus. I often run into a situation where I input some number and then try to do something, but can't because SpinBox eats my input. It's especially a problem when there is no other control that you can click to release the focus. Also it doesn't help that the only way to remove focus is using left click, which can sometimes lead to unwanted actions, like painting something in an editor.

Describe the feature / enhancement and how it helps to overcome the problem or limitation

SpinBox should lose focus when pressing Escape.

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

Here's the implementation:
godotengine/godot@e6aaab0
The change actually had to be done in LineEdit, because it's what SpinBox uses internally.

If this enhancement will not be used often, can it be worked around with a few lines of script?

It can, but if you need to attach such script to every SpinBox then it probably qualifies as used often.

Is there a reason why this should be core and not an add-on in the asset library?

See above. There is no global solution that can be an addon.

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

Successfully merging a pull request may close this issue.

2 participants