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

Add CloseButtonDisplayPolicy in TabContainer #2287

Open
me2beats opened this issue Feb 14, 2021 · 0 comments
Open

Add CloseButtonDisplayPolicy in TabContainer #2287

me2beats opened this issue Feb 14, 2021 · 0 comments

Comments

@me2beats
Copy link

me2beats commented Feb 14, 2021

Describe the project you are working on

plugins

Describe the problem or limitation you are having in your project

I need an easy way to add close buttons in TabContainer like Godot Editor scene tabs have
tabs

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

Adding CloseButtonDisplayPolicy in TabContainer would solve the problem

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

This could work the same way as in Tabs https://docs.godotengine.org/ru/stable/classes/class_tabs.html
see CloseButtonDisplayPolicy

new signal:
int idx close_button_pressed
returns tab index with just pressed button.
I think pressing the button shouldn't close the tab, only emit the signal. User should do this manually using remove_child()

It fits better with the current TabContainer architecture/design (auto closing the tab when pressing its close button) and this is more flexible, as it allows the user to add prompts, for example the popup "do you really want to close this tab?"

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

I could use Tabs but this is not so handy

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

I think close tab buttons is a good UX solution that many modern apps use (popular browsers like Chrome etc).
Godot editor also use it for example in Scene tabs.

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

No branches or pull requests

2 participants