Browse Source

Adjust size of some dialogs

kobewi 2 years ago
parent
commit
71011e0855
3 changed files with 8 additions and 4 deletions
  1. 5 1
      editor/editor_node.cpp
  2. 1 1
      editor/plugins/script_editor_plugin.cpp
  3. 2 2
      editor/project_manager.cpp

+ 5 - 1
editor/editor_node.cpp

@@ -1143,7 +1143,7 @@ void EditorNode::_scan_external_changes() {
 	}
 	}
 
 
 	if (need_reload) {
 	if (need_reload) {
-		disk_changed->call_deferred(SNAME("popup_centered_ratio"), 0.5);
+		disk_changed->call_deferred(SNAME("popup_centered_ratio"), 0.3);
 	}
 	}
 }
 }
 
 
@@ -3011,6 +3011,7 @@ void EditorNode::_menu_option_confirm(int p_option, bool p_confirmed) {
 							save_confirmation->set_ok_button_text(TTR("Save & Quit"));
 							save_confirmation->set_ok_button_text(TTR("Save & Quit"));
 							save_confirmation->set_text(TTR("Save modified resources before closing?"));
 							save_confirmation->set_text(TTR("Save modified resources before closing?"));
 						}
 						}
+						save_confirmation->reset_size();
 						save_confirmation->popup_centered();
 						save_confirmation->popup_centered();
 						break;
 						break;
 					}
 					}
@@ -3039,6 +3040,7 @@ void EditorNode::_menu_option_confirm(int p_option, bool p_confirmed) {
 						save_confirmation->set_ok_button_text(TTR("Save & Quit"));
 						save_confirmation->set_ok_button_text(TTR("Save & Quit"));
 						save_confirmation->set_text((p_option == FILE_QUIT ? TTR("Save changes to the following scene(s) before quitting?") : TTR("Save changes to the following scene(s) before opening Project Manager?")) + unsaved_scenes);
 						save_confirmation->set_text((p_option == FILE_QUIT ? TTR("Save changes to the following scene(s) before quitting?") : TTR("Save changes to the following scene(s) before opening Project Manager?")) + unsaved_scenes);
 					}
 					}
+					save_confirmation->reset_size();
 					save_confirmation->popup_centered();
 					save_confirmation->popup_centered();
 				}
 				}
 
 
@@ -5471,6 +5473,7 @@ void EditorNode::_scene_tab_closed(int p_tab, int p_option) {
 			save_confirmation->set_ok_button_text(TTR("Save & Close"));
 			save_confirmation->set_ok_button_text(TTR("Save & Close"));
 			save_confirmation->set_text(vformat(TTR("Save changes to '%s' before closing?"), !scene_filename.is_empty() ? scene_filename : "unsaved scene"));
 			save_confirmation->set_text(vformat(TTR("Save changes to '%s' before closing?"), !scene_filename.is_empty() ? scene_filename : "unsaved scene"));
 		}
 		}
+		save_confirmation->reset_size();
 		save_confirmation->popup_centered();
 		save_confirmation->popup_centered();
 	} else {
 	} else {
 		_discard_changes();
 		_discard_changes();
@@ -7770,6 +7773,7 @@ EditorNode::EditorNode() {
 	save_confirmation = memnew(ConfirmationDialog);
 	save_confirmation = memnew(ConfirmationDialog);
 	save_confirmation->add_button(TTR("Don't Save"), DisplayServer::get_singleton()->get_swap_cancel_ok(), "discard");
 	save_confirmation->add_button(TTR("Don't Save"), DisplayServer::get_singleton()->get_swap_cancel_ok(), "discard");
 	gui_base->add_child(save_confirmation);
 	gui_base->add_child(save_confirmation);
+	save_confirmation->set_min_size(Vector2(450.0 * EDSCALE, 0));
 	save_confirmation->connect("confirmed", callable_mp(this, &EditorNode::_menu_confirm_current));
 	save_confirmation->connect("confirmed", callable_mp(this, &EditorNode::_menu_confirm_current));
 	save_confirmation->connect("custom_action", callable_mp(this, &EditorNode::_discard_changes));
 	save_confirmation->connect("custom_action", callable_mp(this, &EditorNode::_discard_changes));
 
 

+ 1 - 1
editor/plugins/script_editor_plugin.cpp

@@ -1060,7 +1060,7 @@ bool ScriptEditor::_test_script_times_on_disk(Ref<Resource> p_for_script) {
 			script_editor->reload_scripts();
 			script_editor->reload_scripts();
 			need_reload = false;
 			need_reload = false;
 		} else {
 		} else {
-			disk_changed->call_deferred(SNAME("popup_centered_ratio"), 0.5);
+			disk_changed->call_deferred(SNAME("popup_centered_ratio"), 0.3);
 		}
 		}
 	}
 	}
 
 

+ 2 - 2
editor/project_manager.cpp

@@ -2172,7 +2172,7 @@ void ProjectManager::_open_selected_projects_ask() {
 		return;
 		return;
 	}
 	}
 
 
-	const Size2i popup_min_size = Size2i(600.0 * EDSCALE, 400.0 * EDSCALE);
+	const Size2i popup_min_size = Size2i(600.0 * EDSCALE, 0);
 
 
 	if (selected_list.size() > 1) {
 	if (selected_list.size() > 1) {
 		multi_open_ask->set_text(vformat(TTR("You requested to open %d projects in parallel. Do you confirm?\nNote that usual checks for engine version compatibility will be bypassed."), selected_list.size()));
 		multi_open_ask->set_text(vformat(TTR("You requested to open %d projects in parallel. Do you confirm?\nNote that usual checks for engine version compatibility will be bypassed."), selected_list.size()));
@@ -2257,7 +2257,7 @@ void ProjectManager::_open_selected_projects_ask() {
 
 
 void ProjectManager::_full_convert_button_pressed() {
 void ProjectManager::_full_convert_button_pressed() {
 	ask_update_settings->hide();
 	ask_update_settings->hide();
-	ask_full_convert_dialog->popup_centered(Size2i(600.0 * EDSCALE, 400.0 * EDSCALE));
+	ask_full_convert_dialog->popup_centered(Size2i(600.0 * EDSCALE, 0));
 	ask_full_convert_dialog->get_cancel_button()->grab_focus();
 	ask_full_convert_dialog->get_cancel_button()->grab_focus();
 }
 }