Skip to content

Commit

Permalink
Set an appropriate minimum size for labels in windows that display in…
Browse files Browse the repository at this point in the history
…correctly

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.
  • Loading branch information
Rindbee committed Jan 12, 2024
1 parent 26b1fd0 commit f932c65
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions editor/export/project_export.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);

{
Expand Down
4 changes: 4 additions & 0 deletions editor/import/dynamic_font_import_settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit f932c65

Please sign in to comment.