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

Make inspector spacing more themable #93435

Merged
merged 1 commit into from
Jun 24, 2024

Conversation

passivestar
Copy link
Contributor

Some tweaks to make it easier to establish visual hierarchy in the inspector:

Before After
before after
  • Takes the content margins of EditorInspectorCategory/styles/bg into account when calculating EditorInspectorCategory min height to allow independent padding inside of it. It was only controllable through Tree v_separation, making it impossible to set independently from all of the trees in the editor
  • Exposes EditorInspector main vbox separation to theming to allow space between inspector categories and sections
  • Makes horizontal spacing of EditorInspectorSection themable (space between the arrow and the text)
  • Ensures that text is vertically centered in categories and sections (with floor() they were 1px shy, you can notice if you look real close at those category sections on the left picture)

Note: when using vertical separation there's double separation below some node categories (like Node and Node3D) because there's a 0-height vbox hidden in there (not yet sure what it's for, probably some warning). I think VBoxContainer shouldn't do separation between 0-size controls, this is perhaps something to fix in a future PR

I also want to make section backgrounds themable to support rounded corners but they are drawn immediately through draw_rect because they're using different alphas depending on the nesting level. Maybe I should generate 5-6 stylebox variations for different levels. Something for a future PR as well

@KoBeWi
Copy link
Member

KoBeWi commented Jun 22, 2024

This makes the section headers bigger in the default theme. Is this intentional?
It does not look bad, but it takes more space.

I think VBoxContainer shouldn't do separation between 0-size controls

Nah, it's fine like that. If you don't want separation, the Control should be hidden.

@passivestar
Copy link
Contributor Author

passivestar commented Jun 22, 2024

This makes the section headers bigger in the default theme. Is this intentional?

Not intentional, will fix

@AThousandShips
Copy link
Member

I'd call it "spacing" and not "whitespace" as this doesn't affect label or other text whitespace, so "spacing" or "separation" would be a less confusing naming IMO

@passivestar
Copy link
Contributor Author

meant whitespace as it'd be used in design to refer to empty space, but I understand how it can be confusing

@passivestar passivestar changed the title Make inspector whitespace more themable Make inspector spacing more themable Jun 22, 2024
@akien-mga akien-mga modified the milestones: 4.x, 4.3 Jun 24, 2024
@akien-mga akien-mga merged commit d4d123c into godotengine:master Jun 24, 2024
16 checks passed
@akien-mga
Copy link
Member

Thanks!

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

Successfully merging this pull request may close these issues.

4 participants