From f932c6548eedb56c6d1fba20477848f854633608 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=A3=8E=E9=9D=92=E5=B1=B1?= Date: Thu, 14 Dec 2023 10:41:22 +0800 Subject: [PATCH] Set an appropriate minimum size for labels in windows that display incorrectly When the label's `autowrap_mode` is `AUTOWRAP_WORD_SMART` and the initial `text` is set at the same time, it may have a higher height. Set an appropriate minimum size for labels in windows that display incorrectly so that these controls display properly. --- editor/export/project_export.cpp | 1 + editor/import/dynamic_font_import_settings.cpp | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/editor/export/project_export.cpp b/editor/export/project_export.cpp index b22f70b0fa77..4c0efde4c530 100644 --- a/editor/export/project_export.cpp +++ b/editor/export/project_export.cpp @@ -1277,6 +1277,7 @@ ProjectExportDialog::ProjectExportDialog() { server_strip_message = memnew(Label); server_strip_message->set_visible(false); server_strip_message->set_autowrap_mode(TextServer::AUTOWRAP_WORD_SMART); + server_strip_message->set_custom_minimum_size(Size2(300 * EDSCALE, 1)); resources_vb->add_child(server_strip_message); { diff --git a/editor/import/dynamic_font_import_settings.cpp b/editor/import/dynamic_font_import_settings.cpp index 5564726594f8..ad65fcebd7de 100644 --- a/editor/import/dynamic_font_import_settings.cpp +++ b/editor/import/dynamic_font_import_settings.cpp @@ -1345,6 +1345,7 @@ DynamicFontImportSettingsDialog::DynamicFontImportSettingsDialog() { page2_description->set_text(TTR("Add font size, and variation coordinates, and select glyphs to pre-render:")); page2_description->set_h_size_flags(Control::SIZE_EXPAND_FILL); page2_description->set_autowrap_mode(TextServer::AUTOWRAP_WORD_SMART); + page2_description->set_custom_minimum_size(Size2(300 * EDSCALE, 1)); page2_vb->add_child(page2_description); HSplitContainer *page2_hb = memnew(HSplitContainer); @@ -1418,6 +1419,7 @@ DynamicFontImportSettingsDialog::DynamicFontImportSettingsDialog() { page2_0_description->set_text(TTR("Select translations to add all required glyphs to pre-render list:")); page2_0_description->set_h_size_flags(Control::SIZE_EXPAND_FILL); page2_0_description->set_autowrap_mode(TextServer::AUTOWRAP_WORD_SMART); + page2_0_description->set_custom_minimum_size(Size2(300 * EDSCALE, 1)); page2_0_vb->add_child(page2_0_description); locale_tree = memnew(Tree); @@ -1449,6 +1451,7 @@ DynamicFontImportSettingsDialog::DynamicFontImportSettingsDialog() { page2_1_description->set_text(TTR("Enter a text and select OpenType features to shape and add all required glyphs to pre-render list:")); page2_1_description->set_h_size_flags(Control::SIZE_EXPAND_FILL); page2_1_description->set_autowrap_mode(TextServer::AUTOWRAP_WORD_SMART); + page2_1_description->set_custom_minimum_size(Size2(300 * EDSCALE, 1)); page2_1_vb->add_child(page2_1_description); HSplitContainer *page2_1_hb = memnew(HSplitContainer); @@ -1486,6 +1489,7 @@ DynamicFontImportSettingsDialog::DynamicFontImportSettingsDialog() { page2_2_description->set_text(TTR("Add or remove glyphs from the character map to pre-render list:\nNote: Some stylistic alternatives and glyph variants do not have one-to-one correspondence to character, and not shown in this map, use \"Glyphs from the text\" tab to add these.")); page2_2_description->set_h_size_flags(Control::SIZE_EXPAND_FILL); page2_2_description->set_autowrap_mode(TextServer::AUTOWRAP_WORD_SMART); + page2_2_description->set_custom_minimum_size(Size2(300 * EDSCALE, 1)); page2_2_vb->add_child(page2_2_description); HSplitContainer *glyphs_split = memnew(HSplitContainer);