Przeglądaj źródła

Make sure `Window`'s title is respected before we compute the size

Also removes some suspicious and outdated code that forced this particular
dialog to change size when the warning message changed.

(cherry picked from commit d9677be0cab2274a4e53ac34783ba7539b52ab8f)
Yuri Sizov 1 rok temu
rodzic
commit
511b4f822a
2 zmienionych plików z 5 dodań i 12 usunięć
  1. 1 6
      editor/project_manager.cpp
  2. 4 6
      scene/main/window.cpp

+ 1 - 6
editor/project_manager.cpp

@@ -101,12 +101,6 @@ void ProjectDialog::_set_message(const String &p_msg, MessageType p_type, InputT
 	} else if (current_install_icon != new_icon && input_type == INSTALL_PATH) {
 	} else if (current_install_icon != new_icon && input_type == INSTALL_PATH) {
 		install_status_rect->set_texture(new_icon);
 		install_status_rect->set_texture(new_icon);
 	}
 	}
-
-	Size2i window_size = get_size();
-	Size2 contents_min_size = get_contents_minimum_size();
-	if (window_size.x < contents_min_size.x || window_size.y < contents_min_size.y) {
-		set_size(window_size.max(contents_min_size));
-	}
 }
 }
 
 
 String ProjectDialog::_test_path() {
 String ProjectDialog::_test_path() {
@@ -868,6 +862,7 @@ ProjectDialog::ProjectDialog() {
 
 
 	msg = memnew(Label);
 	msg = memnew(Label);
 	msg->set_horizontal_alignment(HORIZONTAL_ALIGNMENT_CENTER);
 	msg->set_horizontal_alignment(HORIZONTAL_ALIGNMENT_CENTER);
+	msg->set_custom_minimum_size(Size2(200, 0) * EDSCALE);
 	vb->add_child(msg);
 	vb->add_child(msg);
 
 
 	// Renderer selection.
 	// Renderer selection.

+ 4 - 6
scene/main/window.cpp

@@ -967,6 +967,10 @@ Size2i Window::_clamp_window_size(const Size2i &p_size) {
 
 
 void Window::_update_window_size() {
 void Window::_update_window_size() {
 	Size2i size_limit = get_clamped_minimum_size();
 	Size2i size_limit = get_clamped_minimum_size();
+	if (!embedder && window_id != DisplayServer::INVALID_WINDOW_ID && keep_title_visible) {
+		Size2i title_size = DisplayServer::get_singleton()->window_get_title_size(tr_title, window_id);
+		size_limit = size_limit.max(title_size);
+	}
 
 
 	size = size.max(size_limit);
 	size = size.max(size_limit);
 
 
@@ -998,12 +1002,6 @@ void Window::_update_window_size() {
 		}
 		}
 
 
 		DisplayServer::get_singleton()->window_set_max_size(max_size_used, window_id);
 		DisplayServer::get_singleton()->window_set_max_size(max_size_used, window_id);
-
-		if (keep_title_visible) {
-			Size2i title_size = DisplayServer::get_singleton()->window_get_title_size(tr_title, window_id);
-			size_limit = size_limit.max(title_size);
-		}
-
 		DisplayServer::get_singleton()->window_set_min_size(size_limit, window_id);
 		DisplayServer::get_singleton()->window_set_min_size(size_limit, window_id);
 		DisplayServer::get_singleton()->window_set_size(size, window_id);
 		DisplayServer::get_singleton()->window_set_size(size, window_id);
 	}
 	}