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

Undocumented metadata _tab_name, _tab_icon, etc. for children of TabContainer #6002

Closed
MatthijsMud opened this issue Jul 29, 2022 · 2 comments
Labels
archived area:class reference Issues and PRs about the class reference, which should be addressed on the Godot engine repository enhancement

Comments

@MatthijsMud
Copy link

MatthijsMud commented Jul 29, 2022

Your Godot version:
Godot 3.4.4.stable.mono

Issue description:
The documentation for TabContainer does not seem to include any information about the metadata _tab_name , _tab_icon, _tab_hidden, and _tab_disabled.


The class TabContainer by default uses the name of a child Control for the title of its corresponding tab. There are however cases imaginable where a user might want to use text that is not allowed for node names (i.e. duplicate names for tabs, tabs without text, or tabs with special characters). This can be done by calling set_tab_title. set_tab_icon, set_tab_hidden, and set_tab_disabled serve similar purposes, respectively changing the icon, visibility and enabledness of the tab.

In version 3.X this appears to be done by setting the above metadata on the relevant node. Version 4 seems to have moved some of the metadata.

By manually changing the metadata in the text file a user could preview the changes in the editor without messing around with signals, needing to write a tool script, or waiting for the editor UI to be improved.

URL to the documentation page (if already existing):
Some of the pages related to TabContainer don't seem to mention this feature (or implementation detail), so it is just something one might stumble upon instead.

@YuriSizov
Copy link
Contributor

YuriSizov commented Jul 29, 2022

The editor improvements are already being worked on in godotengine/godot#58749

We don't normally document metadata, as you aren't supposed to edit it by hand. Instead you must use the methods which are exposed. Nothing has changed in that regard between 3.x and 4.x.

@YuriSizov YuriSizov added the area:class reference Issues and PRs about the class reference, which should be addressed on the Godot engine repository label Jul 29, 2022
@MatthijsMud
Copy link
Author

Allright, I wasn't aware that metadata wasn't normally documented; it makes sense when considering it an implementation detail, thus allowing for changing it between versions without considering it a breaking change.

When researching I might have been focused a bit too much on the metadata aspect that I have missed those improvements. Looks nice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
archived area:class reference Issues and PRs about the class reference, which should be addressed on the Godot engine repository enhancement
Projects
None yet
Development

No branches or pull requests

2 participants