Explorar el Código

Fix project manager display at small window sizes

- Don't use minimum size for project order/filter controls.
  This also allows the filter field to become longer at large
  window sizes.
- Hide the loading label instead of changing its opacity.
  This causes a reflow during loading, but this is preferable to having
  the UI overflow.
- Hide the language dropdown on Android as it doesn't work correctly.

This allows the project manager to be displayed correctly at much
lower window sizes than previously.
Hugo Locurcio hace 3 años
padre
commit
bc91b89203
Se han modificado 1 ficheros con 11 adiciones y 6 borrados
  1. 11 6
      editor/project_manager.cpp

+ 11 - 6
editor/project_manager.cpp

@@ -1987,7 +1987,7 @@ void ProjectManager::_global_menu_action(const Variant &p_id, const Variant &p_m
 void ProjectManager::_open_selected_projects() {
 	// Show loading text to tell the user that the project manager is busy loading.
 	// This is especially important for the HTML5 project manager.
-	loading_label->set_modulate(Color(1, 1, 1));
+	loading_label->show();
 
 	const Set<String> &selected_list = _project_list->get_selected_project_keys();
 
@@ -2472,8 +2472,8 @@ ProjectManager::ProjectManager() {
 	loading_label->add_font_override("font", get_font("bold", "EditorFonts"));
 	loading_label->set_h_size_flags(Control::SIZE_EXPAND_FILL);
 	sort_filters->add_child(loading_label);
-	// Hide the label but make it still take up space. This prevents reflows when showing the label.
-	loading_label->set_modulate(Color(0, 0, 0, 0));
+	// The loading label is shown later.
+	loading_label->hide();
 
 	Label *sort_label = memnew(Label);
 	sort_label->set_text(TTR("Sort:"));
@@ -2488,7 +2488,6 @@ ProjectManager::ProjectManager() {
 	project_order_filter->set_filter_size(150);
 	sort_filters->add_child(project_order_filter);
 	project_order_filter->connect("filter_changed", this, "_on_order_option_changed");
-	project_order_filter->set_custom_minimum_size(Size2(180, 10) * EDSCALE);
 
 	int projects_sorting_order = (int)EditorSettings::get_singleton()->get("project_manager/sorting_order");
 	project_order_filter->set_filter_option((ProjectListFilter::FilterOption)projects_sorting_order);
@@ -2496,7 +2495,7 @@ ProjectManager::ProjectManager() {
 	project_filter = memnew(ProjectListFilter);
 	project_filter->add_search_box();
 	project_filter->connect("filter_changed", this, "_on_filter_option_changed");
-	project_filter->set_custom_minimum_size(Size2(280, 10) * EDSCALE);
+	project_filter->set_h_size_flags(SIZE_EXPAND_FILL);
 	sort_filters->add_child(project_filter);
 
 	search_tree_vb->add_child(sort_filters);
@@ -2629,6 +2628,12 @@ ProjectManager::ProjectManager() {
 	language_btn = memnew(OptionButton);
 	language_btn->set_flat(true);
 	language_btn->set_focus_mode(Control::FOCUS_NONE);
+#ifdef ANDROID_ENABLED
+	// The language selection dropdown doesn't work on Android (as the setting isn't saved), see GH-60353.
+	// Also, the dropdown it spawns is very tall and can't be scrolled without a hardware mouse.
+	// Hiding the language selection dropdown also leaves more space for the version label to display.
+	language_btn->hide();
+#endif
 
 	Vector<String> editor_languages;
 	List<PropertyInfo> editor_settings_properties;
@@ -2705,7 +2710,7 @@ ProjectManager::ProjectManager() {
 	gui_base->add_child(ask_update_settings);
 
 	// Define a minimum window size to prevent UI elements from overlapping or being cut off.
-	OS::get_singleton()->set_min_window_size(Size2(750, 420) * EDSCALE);
+	OS::get_singleton()->set_min_window_size(Size2(520, 350) * EDSCALE);
 
 	// Resize the bootsplash window based on editor display scale.
 	const float scale_factor = MAX(1, EDSCALE);