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

Improve the looks of 2D/3D viewport contextual toolbars #81557

Merged
merged 1 commit into from
Sep 14, 2023

Conversation

YuriSizov
Copy link
Contributor

@YuriSizov YuriSizov commented Sep 11, 2023

Fixing two annoyances about contextual toolbars:

  1. The panel style is visually compressing, making extra toolbars look weird compared to static toolbars.
  2. There is always an extra vertical separator at the start of it.

To address the first one I've added expand margins to all sides. I also replaced a control that was used to add extra left padding to the whole toolbar row with a margin container, so this extra padding is added to rows wrapped by the FlowContainer.

To address the second I've added some extra logic to dynamically add separators when we add controls to the toolbar. These automatic separators correctly react to their owner node being hidden and shown too. To make this work, I had to remove hardcoded separators from all custom toolbars, and in some cases rework the layout a bit (for the better).

This does mean that if any user plugins have hardcoded VSeparator, it will look meh, because one would be added by us anyway. But to fix this they would simply need to remove their extra node, et voila, a consistent and neat look!

Some before-and-afters

godot windows editor dev x86_64_2023-09-11_23-52-43 godot windows editor dev x86_64_2023-09-11_23-48-20
godot windows editor dev x86_64_2023-09-11_23-52-52 godot windows editor dev x86_64_2023-09-11_23-48-06
godot windows editor dev x86_64_2023-09-11_23-53-00 godot windows editor dev x86_64_2023-09-11_23-47-55
godot windows editor dev x86_64_2023-09-12_00-02-21 godot windows editor dev x86_64_2023-09-11_23-47-18
godot windows editor dev x86_64_2023-09-12_00-02-28 godot windows editor dev x86_64_2023-09-11_23-47-05

editor/plugins/node_3d_editor_plugin.cpp Outdated Show resolved Hide resolved
editor/plugins/node_3d_editor_plugin.cpp Outdated Show resolved Hide resolved
editor/plugins/canvas_item_editor_plugin.cpp Outdated Show resolved Hide resolved
@akien-mga akien-mga merged commit 5a74ce9 into godotengine:master Sep 14, 2023
15 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