0 votes

Just like the Google Chrome browser, I would also like to add a button to add a new one at the end of the tabs. I welcome any suggestions.

in Engine by (2,050 points)

1 Answer

+2 votes

I used a Tabs control which is simply like a button that doesn't depend on any child,
to align it to the top I put it inside a VboxContainer.
To add new tabs (Contrary to the intuition of adding or duplicating the Tabs control) I using code:

addtab ("tab1")
tab ("tab2")

And to show the close button on the selected tab:

settabclosedisplaypolicy (CLOSEBUTTONSHOWACTIVEONLY)

I still have to see how to display a custom tab with the + symbol and not show the close button when clicked...

by (2,050 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.