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 new "item" StyleBox to the Tree Control #74321

Closed
wants to merge 529 commits into from

Conversation

joao-pedro-braz
Copy link
Contributor

@joao-pedro-braz joao-pedro-braz commented Mar 3, 2023

Description

This PR adds a new "item" StyleBox to the Tree Control. Currently, an item will only receive a StyleBox when it's either focused or selected, this PR aims to fix that, and let users specify a StyleBox for the item on it's base state. Besides that, special care has been taken to ensure that the Content Margins are properly handled, acting as padding in both RTL and LTR layouts.

This PR also makes use of this newly added feature to adjust the Editor Theme.
Previously, icons, like the ones in the FileSystemDock or even in the SceneTree, didn't have proper spacing between borders and would therefore appear too close to them, which was specially noticeable with large Corner Radius values, such as 6.

Comparisons

Currently (pre-PR)

image
File System Dock

image
File System Dock in RTL

With PR

image
File System Dock

image
File System Dock in RTL

Regression Test

Special care was also taken in ensuring that the new StyleBox won't break existing applications.

Without PR

image
Application with a default Tree and with it's first element selected

With PR

image
Application with a default Tree and with it's first element selected

Note: There seems to be a bug in TextLine which causes the text_buf width to be inconsistently reported in RTL layouts. This can be observed as a rapid and frequent change in the text position when resizing the aforementioned FileSystemDock and SceneTree (Only noticeable when the labels are larger than the available space).
This problem was partially addressed by taking into account both the Content Margins
and the icon width (if any) when computing the text_buf's width.

Note 2: This superseeds my previous PR on the subject

@joao-pedro-braz
Copy link
Contributor Author

Do we have any plans on adding Unit Tests for the UI?
Had a look in the tests folder and couldn't find anything related.

@joao-pedro-braz
Copy link
Contributor Author

Any tips on how to fix the workflow error?
It seems related to the documentation

@KoBeWi
Copy link
Member

KoBeWi commented Mar 6, 2023

I think you need to rebase to fix this.

bitsawer and others added 21 commits March 11, 2023 16:35
Having local_space enabled when starting a transform changed the
behavior of VIEW space transforms. Now we disable local_space when
starting a blender transform (there was already logic to restore the
setting after the transform ends).

This also hides the gizmo while performing a blender transform,
otherwise the user will see it snap back and forth between the local and
global alignment. I think the transform looks cleaner with the gizmo
hidden anyways.

Fixes godotengine#59392.
… uncommitted changes.

* Pressing escape while gizmo editing will discard the changes made during that edit 'session'
In the editor, it was possible to set the size of a `SubViewport` even
in cases where a parent `SubViewportContainer` had stretch enabled.

This PR disables editing a `SubViewport.size` while the parent disallows
it and it makes necessary adjustments during `NOTIFICATION_ENTER_TREE`.
If calling set_mesh with a PrimitiveMesh that has pending update, the
_mesh_changed function would be called twice. The first time before
set_base had been called, which could lead to an ERROR message about
trying to set an invalid surface override material.
MultiplayerPeerExtension isn't an exact replacement for
NetworkedMultiplayerCustom, but at least it gets you moving in the right direction.

Engine.editor_hint couldn't be fixed by the renames map, because you have to add a `()` at the end.
rcorre and others added 18 commits March 27, 2023 07:08
Fixes godotengine#75084.

The clamp_to_embedder setting was added in 8be16e0,
but was not set on any of the in-editor dialogs.

This patch sets `clamp_to_embedder` on editor dialogs so they cannot be dragged out of the frame.
This also modifies `clamp_to_embedder` so a window is clamped to the bounds of an embedder when
it pops up and when the parent is resized.
Port robust signal (dis)connection to `ShapeCast2D`
Auto translate popup menus of MenuButton and OptionButton
…ge-floor-ctrl-only

Only change floors in GridMap editor when holding Ctrl/Cmd, not Shift
Incorporating the availability of screen and depth textures for the GLES3 backend
* Make placeholder in editor layout dialog translatable.
* Make messages in scene import settings dialog translatable.
* Mark theme override property categories for translation.
* Typo fixes.
* Navigation agent's `velocity_computed` signal is not emitted by
  `set_velocity`, but at the end of that frame if `set_velocity` is
  called.
* Simplify link in navigation agent's `avoidance_enabled` description.
* Unify `navigation_layers` description across `NavigationAgent{2,3}D`.
* Unify `is_normalized()` description across `Vector2`, `Vector3`, and
  `Vector4`
Fix typos and inconsistencies in classref
Fix for godotengine#75218

Pause notifications are not sent when a node is added as a child. So GPUParticles2D should also obey its can_process status on ENTER_TREE, not just PAUSED/UNPAUSED.
Update GPUParticles2D/3D speed scale on ENTER_TREE
This PR adds a new "item" StyleBox to the Tree Control.
Currently, an item will only receive a StyleBox when it's either
focused or selected, this PR aims to fix that, and let users
specify a StyleBox for the item on it's base state.
Besides that, special care has been taken to ensure
that the Content Margins are properly handled, acting
as padding in both RTL and LTR layouts.

This PR also makes use of this newly added feature to adjust the
Editor Theme.
Previously, icons, like the ones in the FileSystemDock
or even in the SceneTree, didn't have proper spacing between borders.

Note: There seems to be a bug in TextLine which causes
the text_buf width to be inconsistently reported in RTL layouts.
This can be observed as a rapid and frequent change
in the text position when resizing the aforementioned
FileSystemDock and SystemDock. This problem was partially addressed
by taking into account both the Content Margins
and the icon width (if any) when computing the text_buf's width.
(or attempt to, at least)
…abled

This commit updates the double precision vertex transform code from
using the MODEL_MATRIX to now use the MODELVIEW_MATRIX instead.

This can be made possible by transforming the MODELVIEW_MATRIX
back into model space (ie, same space as the MODEL_MATRIX) and then using it as if it were the MODEL_MATRIX.

With this in place we now properly handle VERTEX transformations that
a Material Shader might do, such as billboard-ing.
# Conflicts:
#	doc/classes/Tween.xml
#	editor/project_converter_3_to_4.cpp
#	editor/register_editor_types.cpp
#	platform/macos/display_server_macos.mm
@joao-pedro-braz joao-pedro-braz requested review from a team as code owners March 29, 2023 13:18
@joao-pedro-braz
Copy link
Contributor Author

Closing this because I plan to create a separate branch with these changes (Not sure what I was thinking by using my fork's master)

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.