From 3ab719f5a6e70c4c1acd87999170d3e062e0b6da Mon Sep 17 00:00:00 2001 From: Alexei Kotov Date: Sat, 11 Feb 2023 03:12:17 +0300 Subject: [PATCH] Improve post-process HUD search field usability (0.48.0) --- apps/openmw/mwgui/postprocessorhud.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/apps/openmw/mwgui/postprocessorhud.cpp b/apps/openmw/mwgui/postprocessorhud.cpp index ca2d2b1ee4..d345d19019 100644 --- a/apps/openmw/mwgui/postprocessorhud.cpp +++ b/apps/openmw/mwgui/postprocessorhud.cpp @@ -9,6 +9,8 @@ #include #include +#include + #include #include "../mwrender/postprocessor.hpp" @@ -396,8 +398,14 @@ namespace MWGui if (!technique) continue; - if (!technique->getHidden() && !processor->isTechniqueEnabled(technique) && name.find(mFilter->getCaption()) != std::string::npos) - mInactiveList->addItem(name, technique); + if (!technique->getHidden() && !processor->isTechniqueEnabled(technique)) + { + std::string lowerName = Utf8Stream::lowerCaseUtf8(name); + std::string lowerCaption = mFilter->getCaption(); + lowerCaption = Utf8Stream::lowerCaseUtf8(lowerCaption); + if (lowerName.find(lowerCaption) != std::string::npos) + mInactiveList->addItem(name, technique); + } } for (auto technique : processor->getTechniques()) @@ -408,6 +416,10 @@ namespace MWGui auto tryFocus = [this](ListWrapper* widget, const std::string& hint) { + MyGUI::Widget* oldFocus = MyGUI::InputManager::getInstance().getKeyFocusWidget(); + if (oldFocus == mFilter) + return; + size_t index = widget->findItemIndexWith(hint); if (index != MyGUI::ITEM_NONE)