mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-01-31 10:32:30 +00:00
UI: Fix refocus on no control change.
There's no reason to refresh, and since the views are different without PersistData being called, it breaks the focus. Refreshing now handled via the generation value.
This commit is contained in:
parent
6e4708733c
commit
01edd695c8
@ -48,8 +48,8 @@ class SingleControlMapper : public UI::LinearLayout {
|
||||
public:
|
||||
SingleControlMapper(int pspKey, std::string keyName, ScreenManager *scrm, UI::LinearLayoutParams *layoutParams = nullptr);
|
||||
|
||||
void Update() override;
|
||||
int GetPspKey() const { return pspKey_; }
|
||||
|
||||
private:
|
||||
void Refresh();
|
||||
|
||||
@ -76,7 +76,6 @@ private:
|
||||
int pspKey_;
|
||||
std::string keyName_;
|
||||
ScreenManager *scrm_;
|
||||
bool refresh_ = false;
|
||||
};
|
||||
|
||||
SingleControlMapper::SingleControlMapper(int pspKey, std::string keyName, ScreenManager *scrm, UI::LinearLayoutParams *layoutParams)
|
||||
@ -84,14 +83,6 @@ SingleControlMapper::SingleControlMapper(int pspKey, std::string keyName, Screen
|
||||
Refresh();
|
||||
}
|
||||
|
||||
void SingleControlMapper::Update() {
|
||||
if (refresh_) {
|
||||
refresh_ = false;
|
||||
Refresh();
|
||||
host->UpdateUI();
|
||||
}
|
||||
}
|
||||
|
||||
void SingleControlMapper::Refresh() {
|
||||
Clear();
|
||||
auto mc = GetI18NCategory("MappableControls");
|
||||
@ -187,8 +178,6 @@ void SingleControlMapper::MappedCallback(KeyDef kdf) {
|
||||
break;
|
||||
}
|
||||
g_Config.bMapMouse = false;
|
||||
refresh_ = true;
|
||||
// After this, we do not exist any more. So the refresh_ = true is probably irrelevant.
|
||||
}
|
||||
|
||||
UI::EventReturn SingleControlMapper::OnReplace(UI::EventParams ¶ms) {
|
||||
@ -224,7 +213,6 @@ UI::EventReturn SingleControlMapper::OnDelete(UI::EventParams ¶ms) {
|
||||
int index = atoi(params.v->Tag().c_str());
|
||||
KeyMap::g_controllerMap[pspKey_].erase(KeyMap::g_controllerMap[pspKey_].begin() + index);
|
||||
KeyMap::g_controllerMapGeneration++;
|
||||
refresh_ = true;
|
||||
|
||||
if (index + 1 < rows_.size())
|
||||
rows_[index]->SetFocus();
|
||||
|
Loading…
x
Reference in New Issue
Block a user