mirror of
https://github.com/RetroPie/EmulationStation.git
synced 2024-05-31 18:47:42 -04:00
Compare commits
3 commits
f2e9b2d664
...
3bf0d1e8ef
Author | SHA1 | Date | |
---|---|---|---|
3bf0d1e8ef | |||
4a064a2130 | |||
485b995196 |
|
@ -1,5 +1,6 @@
|
|||
#include "CollectionSystemManager.h"
|
||||
|
||||
#include "components/TextListComponent.h"
|
||||
#include "guis/GuiInfoPopup.h"
|
||||
#include "utils/FileSystemUtil.h"
|
||||
#include "utils/StringUtil.h"
|
||||
|
@ -284,6 +285,8 @@ void CollectionSystemManager::updateCollectionSystem(FileData* file, CollectionS
|
|||
{
|
||||
trimCollectionCount(rootFolder, LAST_PLAYED_MAX, false);
|
||||
ViewController::get()->onFileChanged(rootFolder, FILE_METADATA_CHANGED);
|
||||
// Force re-calculation of cursor position
|
||||
ViewController::get()->getGameListView(curSys)->setViewportTop(TextListComponent<FileData>::REFRESH_LIST_CURSOR_POS);
|
||||
}
|
||||
else
|
||||
ViewController::get()->onFileChanged(rootFolder, FILE_SORTED);
|
||||
|
|
|
@ -392,6 +392,11 @@ void TextListComponent<T>::onCursorChanged(const CursorState& state)
|
|||
template <typename T>
|
||||
void TextListComponent<T>::applyTheme(const std::shared_ptr<ThemeData>& theme, const std::string& view, const std::string& element, unsigned int properties)
|
||||
{
|
||||
if(Settings::getInstance()->getBool("UseFullscreenPaging"))
|
||||
{
|
||||
mViewportTop = REFRESH_LIST_CURSOR_POS;
|
||||
}
|
||||
|
||||
GuiComponent::applyTheme(theme, view, element, properties);
|
||||
|
||||
const ThemeData::ThemeElement* elem = theme->getElement(view, element, "textlist");
|
||||
|
|
|
@ -302,8 +302,7 @@ void GuiMenu::openUISettings()
|
|||
{
|
||||
Scripting::fireEvent("theme-changed", theme_set->getSelected(), oldTheme);
|
||||
CollectionSystemManager::get()->updateSystemsList();
|
||||
ViewController::get()->goToStart();
|
||||
ViewController::get()->reloadAll(); // TODO - replace this with some sort of signal-based implementation
|
||||
ViewController::get()->reloadAll(true); // TODO - replace this with some sort of signal-based implementation
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
@ -555,7 +555,7 @@ void ViewController::reloadGameListView(IGameListView* view, bool reloadTheme)
|
|||
|
||||
}
|
||||
|
||||
void ViewController::reloadAll()
|
||||
void ViewController::reloadAll(bool themeChanged)
|
||||
{
|
||||
// clear all gamelistviews
|
||||
std::map<SystemData*, FileData*> cursorMap;
|
||||
|
@ -567,7 +567,6 @@ void ViewController::reloadAll()
|
|||
}
|
||||
mGameListViews.clear();
|
||||
|
||||
|
||||
// load themes, create gamelistviews and reset filters
|
||||
for(auto it = cursorMap.cbegin(); it != cursorMap.cend(); it++)
|
||||
{
|
||||
|
@ -576,10 +575,13 @@ void ViewController::reloadAll()
|
|||
getGameListView(it->first)->setCursor(it->second);
|
||||
}
|
||||
|
||||
// restore index of first list item on display
|
||||
for(auto it = viewportTopMap.cbegin(); it != viewportTopMap.cend(); it++)
|
||||
if(!themeChanged || !Settings::getInstance()->getBool("UseFullscreenPaging"))
|
||||
{
|
||||
getGameListView(it->first)->setViewportTop(it->second);
|
||||
// restore index of first list item on display
|
||||
for(auto it = viewportTopMap.cbegin(); it != viewportTopMap.cend(); it++)
|
||||
{
|
||||
getGameListView(it->first)->setViewportTop(it->second);
|
||||
}
|
||||
}
|
||||
|
||||
// Rebuild SystemListView
|
||||
|
|
|
@ -28,7 +28,7 @@ public:
|
|||
// the current gamelist view (as it may change to be detailed).
|
||||
void reloadGameListView(IGameListView* gamelist, bool reloadTheme = false);
|
||||
inline void reloadGameListView(SystemData* system, bool reloadTheme = false) { reloadGameListView(getGameListView(system).get(), reloadTheme); }
|
||||
void reloadAll(); // Reload everything with a theme. Used when the "ThemeSet" setting changes.
|
||||
void reloadAll(bool themeChanged = false); // Reload everything with a theme. When the "ThemeSet" setting changes, themeChanged is true.
|
||||
|
||||
// Navigation.
|
||||
void goToNextGameList();
|
||||
|
|
Loading…
Reference in a new issue