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 "inner item margin" to Tree-related controls #6902

Open
joao-pedro-braz opened this issue May 17, 2023 · 0 comments
Open

Add "inner item margin" to Tree-related controls #6902

joao-pedro-braz opened this issue May 17, 2023 · 0 comments

Comments

@joao-pedro-braz
Copy link

Describe the project you are working on

Godot Editor

Describe the problem or limitation you are having in your project

Normal, focus and hover panels on Tree-related control items with icons currently don't have any horizontal separation from their borders. As a result, icons appear too close to the item's edge:
image

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

Implemented in godotengine/godot#75460, an "inner_item_margin" property to the base Tree control allows the horizontal spacing to be specified, which in turn can be used by the editor to solve the previously mentioned issue:
image

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

Again, implemented in godotengine/godot#75460, but in technical terms it's basically updating the effective Tree Item's rect (size and position):

rect.set_size(rect.get_size() - Size2i(theme_cache.inner_item_margin, 0));
rect.set_position(rect.get_position() + Size2i(theme_cache.inner_item_margin, 0));

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

Not as far as I'm aware

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

Involve changes to the rendering code of a Control.

@joao-pedro-braz joao-pedro-braz changed the title Add "inner_item_margin" to Tree-related controls Add "inner item margin" to Tree-related controls May 17, 2023
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