summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--editor/plugins/asset_library_editor_plugin.cpp8
-rw-r--r--editor/plugins/asset_library_editor_plugin.h1
2 files changed, 8 insertions, 1 deletions
diff --git a/editor/plugins/asset_library_editor_plugin.cpp b/editor/plugins/asset_library_editor_plugin.cpp
index eee54f3cd2..3ab8f318a7 100644
--- a/editor/plugins/asset_library_editor_plugin.cpp
+++ b/editor/plugins/asset_library_editor_plugin.cpp
@@ -915,6 +915,11 @@ void EditorAssetLibrary::_search(int p_page) {
_api_request("asset", REQUESTING_SEARCH, args);
}
+void EditorAssetLibrary::_search_text_entered(const String &p_text) {
+
+ _search();
+}
+
HBoxContainer *EditorAssetLibrary::_make_pages(int p_page, int p_page_count, int p_page_len, int p_total_items, int p_current_items) {
HBoxContainer *hbc = memnew(HBoxContainer);
@@ -1280,6 +1285,7 @@ void EditorAssetLibrary::_bind_methods() {
ClassDB::bind_method("_select_category", &EditorAssetLibrary::_select_category);
ClassDB::bind_method("_image_request_completed", &EditorAssetLibrary::_image_request_completed);
ClassDB::bind_method("_search", &EditorAssetLibrary::_search, DEFVAL(0));
+ ClassDB::bind_method("_search_text_entered", &EditorAssetLibrary::_search_text_entered);
ClassDB::bind_method("_install_asset", &EditorAssetLibrary::_install_asset);
ClassDB::bind_method("_manage_plugins", &EditorAssetLibrary::_manage_plugins);
ClassDB::bind_method("_asset_open", &EditorAssetLibrary::_asset_open);
@@ -1309,7 +1315,7 @@ EditorAssetLibrary::EditorAssetLibrary(bool p_templates_only) {
filter = memnew(LineEdit);
search_hb->add_child(filter);
filter->set_h_size_flags(SIZE_EXPAND_FILL);
- filter->connect("text_entered", this, "_search");
+ filter->connect("text_entered", this, "_search_text_entered");
search = memnew(Button(TTR("Search")));
search->connect("pressed", this, "_search");
search_hb->add_child(search);
diff --git a/editor/plugins/asset_library_editor_plugin.h b/editor/plugins/asset_library_editor_plugin.h
index 90d597e70a..5536fbb2ec 100644
--- a/editor/plugins/asset_library_editor_plugin.h
+++ b/editor/plugins/asset_library_editor_plugin.h
@@ -284,6 +284,7 @@ class EditorAssetLibrary : public PanelContainer {
void _search(int p_page = 0);
void _rerun_search(int p_ignore);
+ void _search_text_entered(const String &p_text = "");
void _api_request(const String &p_request, RequestType p_request_type, const String &p_arguments = "");
void _http_request_completed(int p_status, int p_code, const PoolStringArray &headers, const PoolByteArray &p_data);
void _http_download_completed(int p_status, int p_code, const PoolStringArray &headers, const PoolByteArray &p_data);