Merge pull request #48824 from aaronfranke/3.x-scd-minsize

Set a minimum size for status panel elements in ScriptCreateDialog
This commit is contained in:
Rémi Verschelde 2021-05-20 18:03:45 +02:00 committed by GitHub
commit d025f6f797
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 3 deletions

View File

@ -33,9 +33,9 @@
</methods>
<members>
<member name="dialog_hide_on_ok" type="bool" setter="set_hide_on_ok" getter="get_hide_on_ok" override="true" default="false" />
<member name="margin_bottom" type="float" setter="set_margin" getter="get_margin" override="true" default="232.0" />
<member name="margin_right" type="float" setter="set_margin" getter="get_margin" override="true" default="361.0" />
<member name="rect_size" type="Vector2" setter="_set_size" getter="get_size" override="true" default="Vector2( 361, 232 )" />
<member name="margin_bottom" type="float" setter="set_margin" getter="get_margin" override="true" default="258.0" />
<member name="margin_right" type="float" setter="set_margin" getter="get_margin" override="true" default="366.0" />
<member name="rect_size" type="Vector2" setter="_set_size" getter="get_size" override="true" default="Vector2( 366, 258 )" />
<member name="window_title" type="String" setter="set_title" getter="get_title" override="true" default="&quot;Attach Node Script&quot;" />
</members>
<signals>

View File

@ -725,6 +725,7 @@ void ScriptCreateDialog::_update_dialog() {
}
get_ok()->set_disabled(!script_ok);
set_size(Vector2());
minimum_size_changed();
}
@ -758,6 +759,7 @@ ScriptCreateDialog::ScriptCreateDialog() {
/* Error Messages Field */
VBoxContainer *vb = memnew(VBoxContainer);
vb->set_custom_minimum_size(Size2(340, 30) * EDSCALE);
error_label = memnew(Label);
vb->add_child(error_label);
@ -766,6 +768,7 @@ ScriptCreateDialog::ScriptCreateDialog() {
vb->add_child(path_error_label);
builtin_warning_label = memnew(Label);
builtin_warning_label->set_custom_minimum_size(Size2(340, 10) * EDSCALE);
builtin_warning_label->set_text(
TTR("Note: Built-in scripts have some limitations and can't be edited using an external editor."));
vb->add_child(builtin_warning_label);
@ -773,6 +776,7 @@ ScriptCreateDialog::ScriptCreateDialog() {
builtin_warning_label->hide();
script_name_warning_label = memnew(Label);
script_name_warning_label->set_custom_minimum_size(Size2(340, 10) * EDSCALE);
script_name_warning_label->set_text(
TTR("Warning: Having the script name be the same as a built-in type is usually not desired."));
vb->add_child(script_name_warning_label);
@ -781,6 +785,7 @@ ScriptCreateDialog::ScriptCreateDialog() {
script_name_warning_label->hide();
status_panel = memnew(PanelContainer);
status_panel->set_custom_minimum_size(Size2(350, 40) * EDSCALE);
status_panel->set_h_size_flags(Control::SIZE_FILL);
status_panel->add_child(vb);