UI: Have scroll views directly remember their pos.

Kinda like checkboxes, cleaner this way.
This commit is contained in:
Unknown W. Brackets 2021-09-27 23:25:41 -07:00
parent 4d5a63a74e
commit fc78b408b2
4 changed files with 14 additions and 16 deletions

View file

@ -97,7 +97,7 @@ void CwCheatScreen::CreateViews() {
rightScroll_ = new ScrollView(ORIENT_VERTICAL, new LinearLayoutParams(FILL_PARENT, FILL_PARENT, 0.5f));
rightScroll_->SetTag("CwCheats");
rightScroll_->SetScrollToTop(false);
rightScroll_->ScrollTo(g_Config.fCwCheatScrollPosition);
rightScroll_->RememberPosition(&g_Config.fCwCheatScrollPosition);
LinearLayout *rightColumn = new LinearLayoutList(ORIENT_VERTICAL, new LinearLayoutParams(200, FILL_PARENT, actionMenuMargins));
rightScroll_->Add(rightColumn);
@ -140,7 +140,6 @@ void CwCheatScreen::onFinish(DialogResult result) {
if (MIPSComp::jit) {
MIPSComp::jit->ClearCache();
}
g_Config.fCwCheatScrollPosition = rightScroll_->GetScrollPosition();
}
UI::EventReturn CwCheatScreen::OnEnableAll(UI::EventParams &params) {