diff --git a/src/states_screens/addons_screen.cpp b/src/states_screens/addons_screen.cpp index 919e4f969..142fca0b9 100644 --- a/src/states_screens/addons_screen.cpp +++ b/src/states_screens/addons_screen.cpp @@ -170,6 +170,9 @@ void AddonsScreen::init() GUIEngine::TextBoxWidget* w_filter_name = getWidget("filter_name"); w_filter_name->setText(L""); + // Add listener for incremental update when search text is changed + w_filter_name->clearListeners(); + w_filter_name->addListener(this); GUIEngine::SpinnerWidget* w_filter_date = getWidget("filter_date"); w_filter_date->setValue(0); diff --git a/src/states_screens/addons_screen.hpp b/src/states_screens/addons_screen.hpp index b9f686984..8d929c040 100644 --- a/src/states_screens/addons_screen.hpp +++ b/src/states_screens/addons_screen.hpp @@ -21,6 +21,7 @@ #include "addons/addons_manager.hpp" #include "guiengine/screen.hpp" #include "guiengine/widgets/label_widget.hpp" +#include "guiengine/widgets/text_box_widget.hpp" #include "states_screens/dialogs/addons_loading.hpp" /* used for the installed/unsinstalled icons*/ @@ -41,7 +42,8 @@ struct DateFilter { */ class AddonsScreen : public GUIEngine::Screen, public GUIEngine::ScreenSingleton, - public GUIEngine::IListWidgetHeaderListener + public GUIEngine::IListWidgetHeaderListener, + public GUIEngine::ITextBoxWidgetListener { friend class GUIEngine::ScreenSingleton; private: @@ -103,6 +105,12 @@ public: /** \brief implement callback from parent class GUIEngine::Screen */ virtual void onUpdate(float dt) OVERRIDE; + /** \brief rebuild the list based on search text */ + virtual void onTextUpdated() OVERRIDE + { + loadList(); + } + void setLastSelected(); };