Skip to content

Commit ef15855

Browse files
authored
Merge branch 'RetroPie:master' into master
2 parents f3fd88f + 4a064a2 commit ef15855

File tree

6 files changed

+20
-12
lines changed

6 files changed

+20
-12
lines changed

es-app/src/CollectionSystemManager.cpp

+3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#include "CollectionSystemManager.h"
22

3+
#include "components/TextListComponent.h"
34
#include "guis/GuiInfoPopup.h"
45
#include "utils/FileSystemUtil.h"
56
#include "utils/StringUtil.h"
@@ -284,6 +285,8 @@ void CollectionSystemManager::updateCollectionSystem(FileData* file, CollectionS
284285
{
285286
trimCollectionCount(rootFolder, LAST_PLAYED_MAX, false);
286287
ViewController::get()->onFileChanged(rootFolder, FILE_METADATA_CHANGED);
288+
// Force re-calculation of cursor position
289+
ViewController::get()->getGameListView(curSys)->setViewportTop(TextListComponent<FileData>::REFRESH_LIST_CURSOR_POS);
287290
}
288291
else
289292
ViewController::get()->onFileChanged(rootFolder, FILE_SORTED);

es-app/src/components/TextListComponent.h

+5
Original file line numberDiff line numberDiff line change
@@ -392,6 +392,11 @@ void TextListComponent<T>::onCursorChanged(const CursorState& state)
392392
template <typename T>
393393
void TextListComponent<T>::applyTheme(const std::shared_ptr<ThemeData>& theme, const std::string& view, const std::string& element, unsigned int properties)
394394
{
395+
if(Settings::getInstance()->getBool("UseFullscreenPaging"))
396+
{
397+
mViewportTop = REFRESH_LIST_CURSOR_POS;
398+
}
399+
395400
GuiComponent::applyTheme(theme, view, element, properties);
396401

397402
const ThemeData::ThemeElement* elem = theme->getElement(view, element, "textlist");

es-app/src/guis/GuiMenu.cpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -301,8 +301,7 @@ void GuiMenu::openUISettings()
301301
{
302302
Scripting::fireEvent("theme-changed", theme_set->getSelected(), oldTheme);
303303
CollectionSystemManager::get()->updateSystemsList();
304-
ViewController::get()->goToStart();
305-
ViewController::get()->reloadAll(); // TODO - replace this with some sort of signal-based implementation
304+
ViewController::get()->reloadAll(true); // TODO - replace this with some sort of signal-based implementation
306305
}
307306
});
308307
}

es-app/src/views/ViewController.cpp

+7-5
Original file line numberDiff line numberDiff line change
@@ -555,7 +555,7 @@ void ViewController::reloadGameListView(IGameListView* view, bool reloadTheme)
555555

556556
}
557557

558-
void ViewController::reloadAll()
558+
void ViewController::reloadAll(bool themeChanged)
559559
{
560560
// clear all gamelistviews
561561
std::map<SystemData*, FileData*> cursorMap;
@@ -567,7 +567,6 @@ void ViewController::reloadAll()
567567
}
568568
mGameListViews.clear();
569569

570-
571570
// load themes, create gamelistviews and reset filters
572571
for(auto it = cursorMap.cbegin(); it != cursorMap.cend(); it++)
573572
{
@@ -576,10 +575,13 @@ void ViewController::reloadAll()
576575
getGameListView(it->first)->setCursor(it->second);
577576
}
578577

579-
// restore index of first list item on display
580-
for(auto it = viewportTopMap.cbegin(); it != viewportTopMap.cend(); it++)
578+
if(!themeChanged || !Settings::getInstance()->getBool("UseFullscreenPaging"))
581579
{
582-
getGameListView(it->first)->setViewportTop(it->second);
580+
// restore index of first list item on display
581+
for(auto it = viewportTopMap.cbegin(); it != viewportTopMap.cend(); it++)
582+
{
583+
getGameListView(it->first)->setViewportTop(it->second);
584+
}
583585
}
584586

585587
// Rebuild SystemListView

es-app/src/views/ViewController.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class ViewController : public GuiComponent
2828
// the current gamelist view (as it may change to be detailed).
2929
void reloadGameListView(IGameListView* gamelist, bool reloadTheme = false);
3030
inline void reloadGameListView(SystemData* system, bool reloadTheme = false) { reloadGameListView(getGameListView(system).get(), reloadTheme); }
31-
void reloadAll(); // Reload everything with a theme. Used when the "ThemeSet" setting changes.
31+
void reloadAll(bool themeChanged = false); // Reload everything with a theme. When the "ThemeSet" setting changes, themeChanged is true.
3232

3333
// Navigation.
3434
void goToNextGameList();

es-core/src/components/VideoVlcComponent.cpp

+3-4
Original file line numberDiff line numberDiff line change
@@ -344,8 +344,7 @@ void VideoVlcComponent::stopVideo()
344344
void VideoVlcComponent::setMuteMode()
345345
{
346346
Settings *cfg = Settings::getInstance();
347-
if (!cfg->getBool("VideoAudio") || (cfg->getBool("ScreenSaverVideoMute") && mScreensaverMode))
348-
libvlc_audio_set_mute(mMediaPlayer, 1);
349-
else
350-
libvlc_audio_set_mute(mMediaPlayer, 0);
347+
if (!cfg->getBool("VideoAudio") || (cfg->getBool("ScreenSaverVideoMute") && mScreensaverMode)) {
348+
libvlc_media_add_option(mMedia, ":no-audio");
349+
}
351350
}

0 commit comments

Comments
 (0)