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 tab spacing modifier for tabs in TabBar and TabContainer #10057

Open
aaronjyoder opened this issue Jun 27, 2024 · 2 comments · May be fixed by godotengine/godot#103214
Open

Add tab spacing modifier for tabs in TabBar and TabContainer #10057

aaronjyoder opened this issue Jun 27, 2024 · 2 comments · May be fixed by godotengine/godot#103214

Comments

@aaronjyoder
Copy link

aaronjyoder commented Jun 27, 2024

Describe the project you are working on

I am working on a game that implements an options menu with rounded tabs.

Describe the problem or limitation you are having in your project

My options menu has rounded tabs, and thus they require space between the tabs.

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

The ability to add space between tabs allows for higher flexibility in a large range of scenarios, such as rounded tabs, slanted tabs, or tabs with custom cut-outs that may require spacing to look correct.

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

An implementation that supports LTR and RTL can be found in this pull request.

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

This can be worked around in the two following ways:

Styles

Apply a border (>=1px) with a transparent color to tabs.

Issues

  • Creates jagged edges on the left and right side of each tab.
  • Does not work for tabs with colored borders.
  • Only allows you to space tabs apart by a positive even number amount.

Custom Tab Bar Implementation Using Control Nodes

You could use regular Button, Panel, and other control nodes to create a custom tab bar implementation.

Issues

  • Very cumbersome for a setting that should likely be available to begin with.
  • Requires large amounts of scripting and re-implementation of functionality for the addition of a very basic feature.

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

This cannot easily be done via an add-on, as it has all the same cons as creating a custom tab bar implementation using control nodes. On the contrary, it is a comparatively simple change to the engine code that adds a large amount of flexibility to a built-in component, and would be used very frequently. See here, here, here, and here.

@emirljuca
Copy link

Is this still being considered? Is there an alternative?

@aaronjyoder
Copy link
Author

@emirljuca I made a pull request.

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

Successfully merging a pull request may close this issue.

3 participants