mirror of
				https://github.com/RetroDECK/ES-DE.git
				synced 2025-04-10 19:15:13 +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()); | ||||
|         mList.setCursor(cursor); | ||||
| 
 | ||||
|         // Update our cursor stack in case our cursor just
 | ||||
|         // got set to some folder we weren't in before.
 | ||||
|         // 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(); | ||||
|  |  | |||
|  | @ -23,7 +23,7 @@ public: | |||
|     virtual void onThemeChanged(const std::shared_ptr<ThemeData>& theme) override; | ||||
| 
 | ||||
|     virtual FileData* getCursor() override; | ||||
|     virtual void setCursor(FileData* file) override; | ||||
|     virtual void setCursor(FileData* cursor) override; | ||||
|     virtual FileData* getNextEntry() override; | ||||
|     virtual FileData* getPreviousEntry() override; | ||||
|     virtual FileData* getFirstEntry() override; | ||||
|  |  | |||
|  | @ -171,11 +171,29 @@ FileData* GridGameListView::getCursor() | |||
|     return mGrid.getSelected(); | ||||
| } | ||||
| 
 | ||||
| void GridGameListView::setCursor(FileData* file) | ||||
| void GridGameListView::setCursor(FileData* cursor) | ||||
| { | ||||
|     if (!mGrid.setCursor(file) && (!file->isPlaceHolder())) { | ||||
|         populateList(file->getParent()->getChildrenListToDisplay(), file->getParent()); | ||||
|         mGrid.setCursor(file); | ||||
|     if (!mGrid.setCursor(cursor) && (!cursor->isPlaceHolder())) { | ||||
|         populateList(cursor->getParent()->getChildrenListToDisplay(), cursor->getParent()); | ||||
|         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 FileData* getCursor() override; | ||||
|     virtual void setCursor(FileData*) override; | ||||
|     virtual void setCursor(FileData* cursor) override; | ||||
|     virtual FileData* getNextEntry() override; | ||||
|     virtual FileData* getPreviousEntry() override; | ||||
|     virtual FileData* getFirstEntry() override; | ||||
|  |  | |||
		Loading…
	
		Reference in a new issue
	
	 Leon Styhre
						Leon Styhre