Skip to content

Commit

Permalink
Merge branch 'RetroPie:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
Gemba authored Apr 29, 2024
2 parents f3fd88f + 4a064a2 commit ef15855
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 12 deletions.
3 changes: 3 additions & 0 deletions es-app/src/CollectionSystemManager.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include "CollectionSystemManager.h"

#include "components/TextListComponent.h"
#include "guis/GuiInfoPopup.h"
#include "utils/FileSystemUtil.h"
#include "utils/StringUtil.h"
Expand Down Expand Up @@ -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);
Expand Down
5 changes: 5 additions & 0 deletions es-app/src/components/TextListComponent.h
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
3 changes: 1 addition & 2 deletions es-app/src/guis/GuiMenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -301,8 +301,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
}
});
}
Expand Down
12 changes: 7 additions & 5 deletions es-app/src/views/ViewController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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++)
{
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion es-app/src/views/ViewController.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class ViewController : public GuiComponent
// 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();
Expand Down
7 changes: 3 additions & 4 deletions es-core/src/components/VideoVlcComponent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -344,8 +344,7 @@ void VideoVlcComponent::stopVideo()
void VideoVlcComponent::setMuteMode()
{
Settings *cfg = Settings::getInstance();
if (!cfg->getBool("VideoAudio") || (cfg->getBool("ScreenSaverVideoMute") && mScreensaverMode))
libvlc_audio_set_mute(mMediaPlayer, 1);
else
libvlc_audio_set_mute(mMediaPlayer, 0);
if (!cfg->getBool("VideoAudio") || (cfg->getBool("ScreenSaverVideoMute") && mScreensaverMode)) {
libvlc_media_add_option(mMedia, ":no-audio");
}
}

0 comments on commit ef15855

Please sign in to comment.