diff options
Diffstat (limited to 'editor')
-rw-r--r-- | editor/editor_node.cpp | 29 | ||||
-rw-r--r-- | editor/editor_node.h | 3 | ||||
-rw-r--r-- | editor/property_editor.cpp | 9 |
3 files changed, 12 insertions, 29 deletions
diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index 9baa203790..cc7ee44902 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -447,18 +447,6 @@ void EditorNode::_sources_changed(bool p_exist) { void EditorNode::_vp_resized() { } -void EditorNode::_rebuild_import_menu() { - PopupMenu *p = import_menu->get_popup(); - p->clear(); -//p->add_item(TTR("Node From Scene"), FILE_IMPORT_SUBSCENE); -//p->add_separator(); -#if 0 - for (int i = 0; i < editor_import_export->get_import_plugin_count(); i++) { - p->add_item(editor_import_export->get_import_plugin(i)->get_visible_name(), IMPORT_PLUGIN_BASE + i); - } -#endif -} - void EditorNode::_node_renamed() { if (property_editor) @@ -4862,9 +4850,9 @@ EditorNode::EditorNode() { import_wav.instance(); ResourceFormatImporter::get_singleton()->add_importer(import_wav); - //Ref<ResourceImporterOBJ> import_obj; - //import_obj.instance(); - //ResourceFormatImporter::get_singleton()->add_importer(import_obj); + Ref<ResourceImporterOBJ> import_obj; + import_obj.instance(); + ResourceFormatImporter::get_singleton()->add_importer(import_obj); Ref<ResourceImporterScene> import_scene; import_scene.instance(); @@ -5257,15 +5245,6 @@ EditorNode::EditorNode() { menu_panel->add_child( resource_menu ); #endif - import_menu = memnew(MenuButton); - import_menu->set_tooltip(TTR("Import assets to the project.")); - import_menu->set_text(TTR("Import")); - //import_menu->set_icon(gui_base->get_icon("Save","EditorIcons")); - left_menu_hb->add_child(import_menu); - - p = import_menu->get_popup(); - p->connect("id_pressed", this, "_menu_option"); - tool_menu = memnew(MenuButton); tool_menu->set_tooltip(TTR("Miscellaneous project or scene-wide tools.")); tool_menu->set_text(TTR("Tools")); @@ -5960,8 +5939,6 @@ EditorNode::EditorNode() { circle_step_frame = Engine::get_singleton()->get_frames_drawn(); circle_step = 0; - _rebuild_import_menu(); - editor_plugin_screen = NULL; editor_plugins_over = memnew(EditorPluginList); diff --git a/editor/editor_node.h b/editor/editor_node.h index e7f4085fc5..7de713eae9 100644 --- a/editor/editor_node.h +++ b/editor/editor_node.h @@ -242,7 +242,6 @@ private: HBoxContainer *menu_hb; Control *viewport; MenuButton *file_menu; - MenuButton *import_menu; MenuButton *tool_menu; ToolButton *export_button; ToolButton *prev_scene; @@ -447,8 +446,6 @@ private: void _show_messages(); void _vp_resized(); - void _rebuild_import_menu(); - void _save_scene(String p_file, int idx = -1); void _instance_request(const Vector<String> &p_files); diff --git a/editor/property_editor.cpp b/editor/property_editor.cpp index 86136fa78b..1cc58f6dcf 100644 --- a/editor/property_editor.cpp +++ b/editor/property_editor.cpp @@ -2388,6 +2388,10 @@ void PropertyEditor::set_item_text(TreeItem *p_item, int p_type, const String &p RES res = obj->get(p_name).operator RefPtr(); if (res->is_class("Texture")) { int tw = EditorSettings::get_singleton()->get("docks/property_editor/texture_preview_width"); + Vector2 size(res->call("get_width"), res->call("get_height")); + if (size.width < size.height) { + tw = MAX((size.width / size.height) * tw, 1); + } p_item->set_icon_max_width(1, tw); p_item->set_icon(1, res); p_item->set_text(1, ""); @@ -3618,6 +3622,10 @@ void PropertyEditor::update_tree() { if (res->is_class("Texture")) { int tw = EditorSettings::get_singleton()->get("docks/property_editor/texture_preview_width"); + Vector2 size(res->call("get_width"), res->call("get_height")); + if (size.width < size.height) { + tw = MAX((size.width / size.height) * tw, 1); + } item->set_icon_max_width(1, tw); item->set_icon(1, res); item->set_text(1, ""); @@ -4389,6 +4397,7 @@ PropertyEditor::PropertyEditor() { capitalize_paths = true; autoclear = false; tree->set_column_titles_visible(false); + tree->add_constant_override("button_margin", 0); keying = false; read_only = false; |