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

Exposed Control::focus_mode to the scene editor #4300

Merged
merged 1 commit into from
Jun 4, 2016
Merged

Exposed Control::focus_mode to the scene editor #4300

merged 1 commit into from
Jun 4, 2016

Conversation

leezh
Copy link
Contributor

@leezh leezh commented Apr 12, 2016

Allows fine-tuning of tab focusing without using scripts.

Exposed get_focus_mode() to the script
Added focus_mode to the property panels for line-edit and sliders
Added enabled_focus_mode to the property panels for buttons

enabled_focus_mode is used when button is enabled/disabled

@leezh
Copy link
Contributor Author

leezh commented Apr 12, 2016

Actually, hold on one sec. I realised that if you replace a non-interactive control with something like a button, this property gets carried over.

@akien-mga
Copy link
Member

Any update @leezh? :)

@neikeq
Copy link
Contributor

neikeq commented Apr 22, 2016

@leezh I don't understand your last comment. What's wrong with the property being carried? AFAIK, all Control derived classes can change its focus mode.

@leezh
Copy link
Contributor Author

leezh commented Apr 22, 2016

Basically, when you create a control, like a frame, the initial property is FOCUS_NONE. Later on, if you use the replace node tool to change it to say, a button, that property is still going to be FOCUS_NONE. It's not too bad if you remember to change it, but there's no way a beginer would've noticed it. In fact, it's annoying that you have to change it every time you replace a node. And that's my issue.

I've been trying to get it to be like one of those custom theme properties (where you can check and uncheck whether the property is actually saved) but I can't get it to work right.

@neikeq
Copy link
Contributor

neikeq commented Apr 22, 2016

IMO it's fine that way.

@akien-mga
Copy link
Member

Resetting properties to their default value when changing the node type is a more global issue IMO, it also happens for signals for example. As long as it's not a regression, it should not be blocking for this PR.

@akien-mga
Copy link
Member

The last commit seems not to build:

scene/gui/base_button.cpp:380:29: error: variable or field 'set_enabled_focus_mode' declared void
scene/gui/base_button.cpp:380:29: error: 'FocusMode' was not declared in this scope

(see travis logs)

@akien-mga
Copy link
Member

The PR needs rebasing, and still fails to build.

@leezh
Copy link
Contributor Author

leezh commented May 23, 2016

Ah, sorry. Was busy with my thesis until last week. Haven't had a time to sit down and fix this. It was a git pull --rebase that went horribly wrong.

Exposed `get_focus_mode()` to the script
Added `focus_mode` to the property panels for line-edit and sliders
Added `enabled_focus_mode` to the property panels for buttons

enabled_focus_mode is used when button is enabled/disabled
@leezh
Copy link
Contributor Author

leezh commented May 23, 2016

Fixed the problems I made in the last commit and squashed them all together. So what's changed now is that the property is exposed only to a few control types that makes sense.

Also, because of how the BaseButton can switch back and forth when enabling/disabling, I found it far more useful to have an enabled_focus_mode property instead.

@akien-mga akien-mga merged commit cbba9c4 into godotengine:master Jun 4, 2016
@leezh leezh deleted the control_focus_mode branch July 13, 2016 18:01
@aaronfranke aaronfranke added this to the 2.1 milestone Jan 26, 2020
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.

4 participants