Skip to content

Commit

Permalink
Merge pull request Aloshi#786 from Gemba/fix_quicksys_select_scrolling
Browse files Browse the repository at this point in the history
fixes continued scrolling on system leave and reenter navigation
  • Loading branch information
pjft authored Apr 24, 2022
2 parents 3079ef8 + 69ee73c commit b93b19b
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 1 deletion.
4 changes: 4 additions & 0 deletions es-app/src/views/gamelist/BasicGameListView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -161,3 +161,7 @@ std::vector<HelpPrompt> BasicGameListView::getHelpPrompts()
}
return prompts;
}

void BasicGameListView::onFocusLost() {
mList.stopScrolling(true);
}
2 changes: 2 additions & 0 deletions es-app/src/views/gamelist/BasicGameListView.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ class BasicGameListView : public ISimpleGameListView
virtual std::vector<HelpPrompt> getHelpPrompts() override;
virtual void launch(FileData* game) override;

void onFocusLost() override;

protected:
virtual std::string getQuickSystemSelectRightButton() override;
virtual std::string getQuickSystemSelectLeftButton() override;
Expand Down
1 change: 1 addition & 0 deletions es-app/src/views/gamelist/DetailedGameListView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -311,4 +311,5 @@ std::vector<GuiComponent*> DetailedGameListView::getMDValues()

void DetailedGameListView::onFocusLost() {
mDescContainer.reset();
mList.stopScrolling(true);
}
1 change: 1 addition & 0 deletions es-app/src/views/gamelist/VideoGameListView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -401,4 +401,5 @@ void VideoGameListView::onShow()

void VideoGameListView::onFocusLost() {
mDescContainer.reset();
mList.stopScrolling(true);
}
8 changes: 7 additions & 1 deletion es-core/src/components/IList.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,16 @@ class IList : public GuiComponent
return mScrollVelocity;
}

void stopScrolling()
void stopScrolling(bool focusLost = false)
{
if (focusLost) {
// force remove overlay (large two letter display in center) when user scrolls
// at max speed through list and then abruptly leaves the system
mTitleOverlayOpacity = 0;
}
listInput(0);
onCursorChanged(CURSOR_STOPPED);

}

void clear()
Expand Down

0 comments on commit b93b19b

Please sign in to comment.