0 votes

Hi. I have a TabContainer with their respective containers as children:

TabContainer
-Container
-Container2
-Container3

I want the tabs of the containers to fill all the screen width, and to be the same size.
This is an example of how it should look

How could I make this?

in Engine by (103 points)

not a real answer, but you could create your own version using simple buttons, and screens that hide() and show() when you click on them.
a little bit more work but much more customizable

And how could this be done with buttons? Also, wouldn´t that be a bad practice?

Hi! I know this is already months ago but I'm also stuck on the same problem. Did you already found a solution on this one? Or you ended up using the idea commented by Andrea?

Ended up using Andrea's idea. Buttons are way more customizable

And how could this be done with buttons? Also, wouldn´t that be a bad
practice?

Sorry, i literally missed your reply up until now!
Hope you found a solution, if it was me i would have used a TextureButton node: they have all the nice things about buttons (pressed/toggle signal, mouse enter/exited signal) plus you can use your own texture on them.

Then, you can create 3 different control node , one for Item1, one for Item2 and one for Item3, (same position, one on top of the other) and put whatever you need inside of them.
When you click on the button (or hover the mouse) the respective ControlNode get showed and the others get hidden.

To make 3 buttons with the same dimension, alligned, you can either positionate them manually (it's not so hard since they are only 3) or make them child of the HSplitContainer node, in this way they get automatically positionated

Said that, there is probably a way to use the tab node, and include images into the label text, like https://godotengine.org/qa/72087/how-to-add-a-picture-to-the-text
(but i havent tested it personally)

Thanks! I also tried asking it on some people in discord. (and it looks like it is not yet customizable to the way we want). I'll probably use Andrea's answer for now.

Also thanks Andrea for elaborating how to do it!

Please log in or register to answer this question.

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 Frequently asked questions and 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 [email protected] with your username.