Retain focus after popup choice selection.

This commit is contained in:
Unknown W. Brackets 2015-06-27 09:41:53 -07:00
parent 1e3beadb7b
commit 57f44edaea
2 changed files with 7 additions and 0 deletions

View File

@ -255,6 +255,8 @@ UI::EventReturn ListPopupScreen::OnListChoice(UI::EventParams &e) {
namespace UI {
UI::EventReturn PopupMultiChoice::HandleClick(UI::EventParams &e) {
restoreFocus_ = HasFocus();
std::vector<std::string> 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);
}
}
}

View File

@ -218,6 +218,7 @@ private:
I18NCategory *category_;
ScreenManager *screenManager_;
std::string valueText_;
bool restoreFocus_;
};