godotengine / godot-proposals

Godot Improvement Proposals (GIPs)
MIT License
1.16k stars 97 forks source link

VisualShader: Add ability to close "Create Shader Node" window by clicking on anywhere on screen #11213

Open Foyezes opened 11 hours ago

Foyezes commented 11 hours ago

Describe the project you are working on

Working with visual shader

Describe the problem or limitation you are having in your project

Sometimes if I accidentally press right click and open the "Create Shader Node" window, I have to drag my mouse to the minimize button.

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

If there was a system to close the window by clicking on the spaces outside the window that would be super helpful.

Also being able to open a node's setting by directly right clicking on the node directly, instead of having to select the node first will be good. Currently if I rick click on a node directly it opens the "Create shader node" window.

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

Image Image

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

This will be used often

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

VisualShader is core

tetrapod00 commented 11 hours ago

I'll add that it is very standard UX that this kind of Add Node UI does not have the commitment of a full modal dialog. Compare Godot to its peers. In all these videos, when the UI to add a node is open, I am left-clicking to try to close it. The actions taken to open the dialogs vary per program.

Unreal 5:

https://github.com/user-attachments/assets/a64025f9-1d4f-4aa1-8745-e34602b79d6d

Unity 2022:

https://github.com/user-attachments/assets/70aae8fd-6149-437c-91d6-8e6ba93ab0a4

Blender 4:

https://github.com/user-attachments/assets/0d3a6608-4611-4f8e-8a05-d5c78e7acddd

Godot 4.4dev5:

https://github.com/user-attachments/assets/529ea449-4622-4fe5-8da8-95c8316aba0e

Only Godot requires clicking a button on the UI popup to close it. It is also very jarring that right-clicking on an empty graph in Godot is such a high commitment action.

I can see the desire to have a way to add nodes to the visual shader editor that is a full window with a close button; it's a similar logic to having a complex Create New Node window in Godot's 3D editor. However, if we have that, it should be a separate action from the Create New Node UI that appears when you right-click on an empty graph. The UI that appears when adding a node in an empty graph, or adding a node from dragging a connection, should be low-commitment and allow left clicking anywhere to escape it.