godotengine / godot-proposals

Godot Improvement Proposals (GIPs)
MIT License
1.12k stars 69 forks source link

Add an information label to the editor viewport to see the size of the selected `Control` #5288

Open Chaosus opened 2 years ago

Chaosus commented 2 years ago

Describe the project you are working on

Any project with UI and controls.

Describe the problem or limitation you are having in your project

I cannot see the size of the selected Control (when they are children of the parent Control) which is sometimes important to see for the design and place of other controls:

size

As you can see, the real size of the control is impossible to see using inspector. It can be obtained through code, but it's very uncomfortable.

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

Add an information Label to the 2D editor.

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

I think the right fix should look like this:

image

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

No

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

It's an editor enhancement.

YuriSizov commented 2 years ago

See also https://github.com/godotengine/godot-proposals/issues/4464, but I like this idea more. Ideally, I'd probably like to see the size and visualized offsets as a part of the GUI gizmo, but we can start with a corner blurb. I like this.

That being said, this doesn't help with the remote view in running projects. But for that we may want to simply display all properties in the remote view, even if they are NO_EDITOR checked. Because this applies to other hidden properties as well, IMO.

Calinou commented 2 years ago

This information could also be extended for selected Node2Ds.

I had a branch that displayed Node2D/Control dimensions along its selection rectangle, but I didn't have time to finish it so far: https://github.com/Calinou/godot/tree/2d-editor-display-selection-size

me2beats commented 2 years ago

I like the idea, this also could be optional (an option to disable/unable it in EditorSettings

me2beats commented 2 years ago

why this property is gone in Inspector in Godot 4 tho?

YuriSizov commented 2 years ago

why this property is gone in Inspector in Godot 4 tho?

It's not gone. It's contextual. It's visible when you can edit it, and it's not visible when you can't. Same as some other related properties. This is done to streamline the experience of users who get confused by all the positioning and sizing options of controls, and different states based on parents that they can have.

me2beats commented 2 years ago

yea, I mean this:

it's not visible when you can't.

Can't it be still visible In inspector (maybe optionally) but just be marked as not editable? The proposed info panel is fine for custom controls to quickly see some values, it also can allow adding multiple properties, but for me it seems Inspector should still be the default place to inspect properties values.

Because someone wants to see rect_size, someone wants to see rect_position, someone - both, someone - none of them etc. So I'm for https://github.com/godotengine/godot-proposals/issues/4464 as well

me2beats commented 2 years ago

btw sometimes I animate buttons positions inside containers. So I even think some hidden properties like rect_position could be optionally editable from inspector

YuriSizov commented 2 years ago

Can't it be still visible In inspector (maybe optionally) but just be marked as not editable?

The point is to reduce confusion. I'm afraid keeping things visible doesn't help with that, as the user is still overwhelmed with a bunch of fields they have no control over and that are not immediately useful.

So I even think some hidden properties like rect_position could be optionally editable from inspector

You should use intermediate controls for that. We cannot promote this workflow because it leads to issues and misunderstandings from users. Simply put, it's unsafe hence why it is disabled.

me2beats commented 2 years ago

The point is to reduce confusion. I'm afraid keeping things visible doesn't help with that, as the user is still overwhelmed with a bunch of fields they have no control over and that are not immediately useful.

I am for making it optional, and hidden by default, so newcomers won't have problems

You should use intermediate controls for that. We cannot promote this workflow because it leads to issues and misunderstandings from users. Simply put, it's unsafe hence why it is disabled.

Got the point. Adding intermediate controls makes the scene more confusing tho.