diff --git a/editor/editor_about.cpp b/editor/editor_about.cpp index 44a3127933b..db25a3dd64b 100644 --- a/editor/editor_about.cpp +++ b/editor/editor_about.cpp @@ -154,7 +154,7 @@ EditorAbout::EditorAbout() { hbc->add_child(version_info_vbc); TabContainer *tc = memnew(TabContainer); - tc->set_custom_minimum_size(Size2(950, 400) * EDSCALE); + tc->set_custom_minimum_size(Size2(400, 200) * EDSCALE); tc->set_v_size_flags(Control::SIZE_EXPAND_FILL); vbc->add_child(tc); diff --git a/editor/plugins/asset_library_editor_plugin.cpp b/editor/plugins/asset_library_editor_plugin.cpp index e81d14f3bc7..14808fc2af9 100644 --- a/editor/plugins/asset_library_editor_plugin.cpp +++ b/editor/plugins/asset_library_editor_plugin.cpp @@ -1341,6 +1341,10 @@ void EditorAssetLibrary::disable_community_support() { support->get_popup()->set_item_checked(SUPPORT_COMMUNITY, false); } +void EditorAssetLibrary::set_columns(const int p_columns) { + asset_items->set_columns(p_columns); +} + void EditorAssetLibrary::_bind_methods() { ClassDB::bind_method("_http_request_completed", &EditorAssetLibrary::_http_request_completed); ClassDB::bind_method("_select_asset", &EditorAssetLibrary::_select_asset); @@ -1426,8 +1430,8 @@ EditorAssetLibrary::EditorAssetLibrary(bool p_templates_only) { search_hb2->add_child(sort); sort->set_h_size_flags(SIZE_EXPAND_FILL); + sort->set_clip_text(true); sort->connect("item_selected", this, "_rerun_search"); - search_hb2->add_child(memnew(VSeparator)); search_hb2->add_child(memnew(Label(TTR("Category:") + " "))); @@ -1435,6 +1439,7 @@ EditorAssetLibrary::EditorAssetLibrary(bool p_templates_only) { categories->add_item(TTR("All")); search_hb2->add_child(categories); categories->set_h_size_flags(SIZE_EXPAND_FILL); + categories->set_clip_text(true); categories->connect("item_selected", this, "_rerun_search"); search_hb2->add_child(memnew(VSeparator)); @@ -1448,6 +1453,7 @@ EditorAssetLibrary::EditorAssetLibrary(bool p_templates_only) { search_hb2->add_child(repository); repository->set_h_size_flags(SIZE_EXPAND_FILL); + repository->set_clip_text(true); search_hb2->add_child(memnew(VSeparator)); diff --git a/editor/plugins/asset_library_editor_plugin.h b/editor/plugins/asset_library_editor_plugin.h index 0f633a18b29..7fe614bf79c 100644 --- a/editor/plugins/asset_library_editor_plugin.h +++ b/editor/plugins/asset_library_editor_plugin.h @@ -303,6 +303,7 @@ protected: public: void disable_community_support(); + void set_columns(int p_columns); EditorAssetLibrary(bool p_templates_only = false); }; diff --git a/editor/project_manager.cpp b/editor/project_manager.cpp index 4e1510cf44f..5a2c6fdf5ee 100644 --- a/editor/project_manager.cpp +++ b/editor/project_manager.cpp @@ -1772,6 +1772,16 @@ void ProjectManager::_notification(int p_what) { if (open_templates->is_visible()) { open_templates->popup_centered_minsize(); } + real_t size = get_size().x / EDSCALE; + asset_library->set_columns(size < 1000 ? 1 : 2); + // Adjust names of tabs to fit the new size. + if (size < 650) { + local_projects_hb->set_name(TTR("Local")); + asset_library->set_name(TTR("Asset Library")); + } else { + local_projects_hb->set_name(TTR("Local Projects")); + asset_library->set_name(TTR("Asset Library Projects")); + } } break; case NOTIFICATION_READY: { if (_project_list->get_project_count() == 0 && StreamPeerSSL::is_available()) { @@ -2449,15 +2459,12 @@ ProjectManager::ProjectManager() { tabs->set_tab_align(TabContainer::ALIGN_LEFT); tabs->connect("tab_changed", this, "_on_tab_changed"); - HBoxContainer *tree_hb = memnew(HBoxContainer); - projects_hb = tree_hb; - - projects_hb->set_name(TTR("Local Projects")); - - tabs->add_child(tree_hb); + local_projects_hb = memnew(HBoxContainer); + local_projects_hb->set_name(TTR("Local Projects")); + tabs->add_child(local_projects_hb); VBoxContainer *search_tree_vb = memnew(VBoxContainer); - tree_hb->add_child(search_tree_vb); + local_projects_hb->add_child(search_tree_vb); search_tree_vb->set_h_size_flags(SIZE_EXPAND_FILL); HBoxContainer *sort_filters = memnew(HBoxContainer); @@ -2507,7 +2514,7 @@ ProjectManager::ProjectManager() { VBoxContainer *tree_vb = memnew(VBoxContainer); tree_vb->set_custom_minimum_size(Size2(120, 120)); - tree_hb->add_child(tree_vb); + local_projects_hb->add_child(tree_vb); Button *open = memnew(Button); open->set_text(TTR("Edit")); diff --git a/editor/project_manager.h b/editor/project_manager.h index 6eb753f71b6..b83599f35bb 100644 --- a/editor/project_manager.h +++ b/editor/project_manager.h @@ -77,7 +77,7 @@ class ProjectManager : public Control { AcceptDialog *dialog_error; ProjectDialog *npdialog; - HBoxContainer *projects_hb; + HBoxContainer *local_projects_hb; TabContainer *tabs; ProjectList *_project_list;