Skip to content

Commit

Permalink
Prevent VisualShader Editor Add/Remove popups from accidentally being…
Browse files Browse the repository at this point in the history
… hidden

VisualShader Editor windows, such as `Create Shader Node`, `Create Shader Varying` and `Delete Shader Varying` open up as dedicated windows and can end up hidden behind the Godot editor if a user clicks more than once when opening these dialogues. A user's natural reaction is to assume the dialogue closed and try to open it again, but nothing will happen when they try to do so, since an open instance actually still exists, which they would have to notice on their task bar for example (which looks just like another Godot instance), otherwise, they will assume there is a bug. It's isn't the best UX.

I propose making these 3 menus "exclusive", since you shouldn't really be trying to do other stuff during them anyways, and this will avoid them accidentally disappearing and confusing users.
  • Loading branch information
Invertex committed Nov 18, 2023
1 parent 80de898 commit 1f2fcad
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions editor/plugins/visual_shader_editor_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5485,7 +5485,7 @@ VisualShaderEditor::VisualShaderEditor() {

members_dialog = memnew(ConfirmationDialog);
members_dialog->set_title(TTR("Create Shader Node"));
members_dialog->set_exclusive(false);
members_dialog->set_exclusive(true);
members_dialog->add_child(members_vb);
members_dialog->set_ok_button_text(TTR("Create"));
members_dialog->get_ok_button()->connect("pressed", callable_mp(this, &VisualShaderEditor::_member_create));
Expand All @@ -5497,7 +5497,7 @@ VisualShaderEditor::VisualShaderEditor() {
{
add_varying_dialog = memnew(ConfirmationDialog);
add_varying_dialog->set_title(TTR("Create Shader Varying"));
add_varying_dialog->set_exclusive(false);
add_varying_dialog->set_exclusive(true);
add_varying_dialog->set_ok_button_text(TTR("Create"));
add_varying_dialog->get_ok_button()->connect("pressed", callable_mp(this, &VisualShaderEditor::_varying_create));
add_varying_dialog->get_ok_button()->set_disabled(true);
Expand Down Expand Up @@ -5543,7 +5543,7 @@ VisualShaderEditor::VisualShaderEditor() {
{
remove_varying_dialog = memnew(ConfirmationDialog);
remove_varying_dialog->set_title(TTR("Delete Shader Varying"));
remove_varying_dialog->set_exclusive(false);
remove_varying_dialog->set_exclusive(true);
remove_varying_dialog->set_ok_button_text(TTR("Delete"));
remove_varying_dialog->get_ok_button()->connect("pressed", callable_mp(this, &VisualShaderEditor::_varying_deleted));
add_child(remove_varying_dialog);
Expand Down

0 comments on commit 1f2fcad

Please sign in to comment.