diff options
author | Noshyaar <poommetee@protonmail.com> | 2017-12-25 19:53:58 +0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-12-25 19:53:58 +0700 |
commit | 2717b7f038fe96249c8dc70c8ece3077b37bb3e4 (patch) | |
tree | 99e4a546ec51b62808228aeef9dd66cdf7f139bc | |
parent | 256a60bc6e05468ba64729f3d972086ab8ae95b5 (diff) | |
parent | cc1d56e3ff2c2ec148f3309dd776c6535c63ba5d (diff) |
Merge pull request #15036 from volzhs/popup-menu-size
Fix popup menu size in Inspector dock
-rw-r--r-- | editor/property_editor.cpp | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/editor/property_editor.cpp b/editor/property_editor.cpp index 64351dec4f..24275f4d88 100644 --- a/editor/property_editor.cpp +++ b/editor/property_editor.cpp @@ -335,6 +335,8 @@ bool CustomPropertyEditor::edit(Object *p_owner, const String &p_name, Variant:: easing_draw->hide(); spinbox->hide(); slider->hide(); + menu->clear(); + menu->set_size(Size2(1, 1) * EDSCALE); for (int i = 0; i < MAX_VALUE_EDITORS; i++) { @@ -413,7 +415,6 @@ bool CustomPropertyEditor::edit(Object *p_owner, const String &p_name, Variant:: } else if (hint == PROPERTY_HINT_ENUM) { - menu->clear(); Vector<String> options = hint_text.split(","); for (int i = 0; i < options.size(); i++) { if (options[i].find(":") != -1) { @@ -494,7 +495,6 @@ bool CustomPropertyEditor::edit(Object *p_owner, const String &p_name, Variant:: easing_draw->show(); set_size(Size2(200, 150) * EDSCALE); } else if (hint == PROPERTY_HINT_FLAGS) { - menu->clear(); Vector<String> flags = hint_text.split(","); for (int i = 0; i < flags.size(); i++) { String flag = flags[i]; @@ -536,7 +536,6 @@ bool CustomPropertyEditor::edit(Object *p_owner, const String &p_name, Variant:: config_action_buttons(names); } else if (hint == PROPERTY_HINT_ENUM) { - menu->clear(); Vector<String> options = hint_text.split(","); for (int i = 0; i < options.size(); i++) { menu->add_item(options[i], i); @@ -869,9 +868,6 @@ bool CustomPropertyEditor::edit(Object *p_owner, const String &p_name, Variant:: if (hint != PROPERTY_HINT_RESOURCE_TYPE) break; - menu->clear(); - menu->set_size(Size2(1, 1) * EDSCALE); - if (p_name == "script" && hint_text == "Script" && Object::cast_to<Node>(owner)) { menu->add_icon_item(get_icon("Script", "EditorIcons"), TTR("New Script"), OBJ_MENU_NEW_SCRIPT); menu->add_separator(); |