mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-11-26 16:15:39 +00:00
Fixed an issue where the cursor stack would not work correctly with the Grid view style.
This commit is contained in:
parent
5ad03f3043
commit
a7f431ae9f
|
@ -115,8 +115,8 @@ void BasicGameListView::setCursor(FileData* cursor)
|
||||||
populateList(cursor->getParent()->getChildrenListToDisplay(), cursor->getParent());
|
populateList(cursor->getParent()->getChildrenListToDisplay(), cursor->getParent());
|
||||||
mList.setCursor(cursor);
|
mList.setCursor(cursor);
|
||||||
|
|
||||||
// Update our cursor stack in case our cursor just
|
// Update our cursor stack in case our cursor just got set to some folder
|
||||||
// got set to some folder we weren't in before.
|
// we weren't in before.
|
||||||
if (mCursorStack.empty() || mCursorStack.top() != cursor->getParent()) {
|
if (mCursorStack.empty() || mCursorStack.top() != cursor->getParent()) {
|
||||||
std::stack<FileData*> tmp;
|
std::stack<FileData*> tmp;
|
||||||
FileData* ptr = cursor->getParent();
|
FileData* ptr = cursor->getParent();
|
||||||
|
|
|
@ -23,7 +23,7 @@ public:
|
||||||
virtual void onThemeChanged(const std::shared_ptr<ThemeData>& theme) override;
|
virtual void onThemeChanged(const std::shared_ptr<ThemeData>& theme) override;
|
||||||
|
|
||||||
virtual FileData* getCursor() override;
|
virtual FileData* getCursor() override;
|
||||||
virtual void setCursor(FileData* file) override;
|
virtual void setCursor(FileData* cursor) override;
|
||||||
virtual FileData* getNextEntry() override;
|
virtual FileData* getNextEntry() override;
|
||||||
virtual FileData* getPreviousEntry() override;
|
virtual FileData* getPreviousEntry() override;
|
||||||
virtual FileData* getFirstEntry() override;
|
virtual FileData* getFirstEntry() override;
|
||||||
|
|
|
@ -171,11 +171,29 @@ FileData* GridGameListView::getCursor()
|
||||||
return mGrid.getSelected();
|
return mGrid.getSelected();
|
||||||
}
|
}
|
||||||
|
|
||||||
void GridGameListView::setCursor(FileData* file)
|
void GridGameListView::setCursor(FileData* cursor)
|
||||||
{
|
{
|
||||||
if (!mGrid.setCursor(file) && (!file->isPlaceHolder())) {
|
if (!mGrid.setCursor(cursor) && (!cursor->isPlaceHolder())) {
|
||||||
populateList(file->getParent()->getChildrenListToDisplay(), file->getParent());
|
populateList(cursor->getParent()->getChildrenListToDisplay(), cursor->getParent());
|
||||||
mGrid.setCursor(file);
|
mGrid.setCursor(cursor);
|
||||||
|
|
||||||
|
// Update our cursor stack in case our cursor just got set to some folder
|
||||||
|
// we weren't in before.
|
||||||
|
if (mCursorStack.empty() || mCursorStack.top() != cursor->getParent()) {
|
||||||
|
std::stack<FileData*> tmp;
|
||||||
|
FileData* ptr = cursor->getParent();
|
||||||
|
while (ptr && ptr != mRoot) {
|
||||||
|
tmp.push(ptr);
|
||||||
|
ptr = ptr->getParent();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Flip the stack and put it in mCursorStack.
|
||||||
|
mCursorStack = std::stack<FileData*>();
|
||||||
|
while (!tmp.empty()) {
|
||||||
|
mCursorStack.push(tmp.top());
|
||||||
|
tmp.pop();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -30,7 +30,7 @@ public:
|
||||||
virtual void onThemeChanged(const std::shared_ptr<ThemeData>& theme) override;
|
virtual void onThemeChanged(const std::shared_ptr<ThemeData>& theme) override;
|
||||||
|
|
||||||
virtual FileData* getCursor() override;
|
virtual FileData* getCursor() override;
|
||||||
virtual void setCursor(FileData*) override;
|
virtual void setCursor(FileData* cursor) override;
|
||||||
virtual FileData* getNextEntry() override;
|
virtual FileData* getNextEntry() override;
|
||||||
virtual FileData* getPreviousEntry() override;
|
virtual FileData* getPreviousEntry() override;
|
||||||
virtual FileData* getFirstEntry() override;
|
virtual FileData* getFirstEntry() override;
|
||||||
|
|
Loading…
Reference in a new issue