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

Set some dialogs in the VisualShader editor to be exclusive #85205

Merged
merged 1 commit into from
Nov 22, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions editor/plugins/visual_shader_editor_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4080,6 +4080,12 @@ void VisualShaderEditor::_show_members_dialog(bool at_mouse_pos, VisualShaderNod
saved_node_pos_dirty = false;
members_dialog->set_position(graph->get_screen_position() + Point2(5 * EDSCALE, 65 * EDSCALE));
}

if (members_dialog->is_visible()) {
members_dialog->grab_focus();
return;
}

jsjtxietian marked this conversation as resolved.
Show resolved Hide resolved
members_dialog->popup();

// Keep dialog within window bounds.
Expand Down Expand Up @@ -5384,6 +5390,7 @@ VisualShaderEditor::VisualShaderEditor() {
preview_window = memnew(Window);
preview_window->set_title(TTR("Generated Shader Code"));
preview_window->set_visible(preview_showed);
preview_window->set_exclusive(true);
preview_window->connect("close_requested", callable_mp(this, &VisualShaderEditor::_preview_close_requested));
preview_window->connect("size_changed", callable_mp(this, &VisualShaderEditor::_preview_size_changed));
add_child(preview_window);
Expand Down Expand Up @@ -5485,7 +5492,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 +5504,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 +5550,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
Loading