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

Refactor layer property editor grid #51039

Merged
merged 1 commit into from
Aug 2, 2021

Conversation

pouleyKetchoupp
Copy link
Contributor

@pouleyKetchoupp pouleyKetchoupp commented Jul 29, 2021

Implements proposal godotengine/godot-proposals#2770 on the master branch (see #51040 for 3.x), based on different comments and suggestions.

List of changes:

  • Now able to display up to 32 layers for physics/navigation in 4x2 blocks (still 20 layers in 5x2 blocks for render because some layers are reserved)
  • Also show 32 layers for physics/navigation layer names in project settings
  • Adjustable grid size to fit available space in dock
  • Expansion icon to display more layers vertically
  • Layer numbers in cells to help with selection (cells are also slightly larger to fit the numbers)

For now I haven't implemented the label for layer names like in godotengine/godot-proposals#2770 (comment), because tooltips are already displaying them and it can wait for feedback before doing further improvements if needed.

Physics layers:
layer_grid_physics_4 0

Render layers:
layer_grid_render_4 0

Rescaling demo (on the 3.x version, but it works the same in the 4.0 version):
collision_layers_grid

@Calinou
Copy link
Member

Calinou commented Jul 30, 2021

Looks good, although I'd try writing the numbers using a translucent version of the default text color (multiply the color by Color(1, 1, 1, 0.5) or so). Black text on a dark theme tends to look out of place.

You can source the editor theme's default font color with this: get_theme_color(SNAME("font_color"), SNAME("Editor"))

- Now able to display up to 32 layers in physics (still 20 for render)
- Adjustable grid size to fit available space in dock
- Expansion icon to display more layers vertically
- Layer numbers in cells to help with selection
@pouleyKetchoupp
Copy link
Contributor Author

@Calinou I've pushed with your suggestion for the text color. It's working well, thanks! I've just made an adjustment for selected layers, I'm using font_hover_color with an alpha multiplied by 0.7 to make it work better with selected squares.

Here's the result with the default theme:
layer_grid_physics_4 0_theme

I'm going to do something a bit different on the 3.x version though, because the highlight color on the squares is much less pronounced and it looks all washed out when using font colors for the texts.

@akien-mga akien-mga merged commit c17a541 into godotengine:master Aug 2, 2021
@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.

3 participants