diff --git a/ui/ui_screen.cpp b/ui/ui_screen.cpp index 8384afee8a..984fe78665 100644 --- a/ui/ui_screen.cpp +++ b/ui/ui_screen.cpp @@ -255,6 +255,8 @@ UI::EventReturn ListPopupScreen::OnListChoice(UI::EventParams &e) { namespace UI { UI::EventReturn PopupMultiChoice::HandleClick(UI::EventParams &e) { + restoreFocus_ = HasFocus(); + std::vector choices; for (int i = 0; i < numChoices_; i++) { choices.push_back(category_ ? category_->T(choices_[i]) : choices_[i]); @@ -288,6 +290,10 @@ void PopupMultiChoice::ChoiceCallback(int num) { e.v = this; e.a = num; OnChoice.Trigger(e); + + if (restoreFocus_) { + SetFocusedView(this); + } } } diff --git a/ui/ui_screen.h b/ui/ui_screen.h index edabf4d262..11d54caca1 100644 --- a/ui/ui_screen.h +++ b/ui/ui_screen.h @@ -218,6 +218,7 @@ private: I18NCategory *category_; ScreenManager *screenManager_; std::string valueText_; + bool restoreFocus_; };