mirror of
https://git.naxdy.org/Mirror/Ryujinx.git
synced 2025-01-09 12:19:12 +00:00
Updating the game list when navigating folders is now on a separate thread like before. tweaked grid mode icon sizes
This commit is contained in:
parent
820d11fbca
commit
1ef15e5107
3 changed files with 34 additions and 30 deletions
|
@ -45,6 +45,7 @@ namespace Ryujinx.UI.App.Common
|
|||
private readonly VirtualFileSystem _virtualFileSystem;
|
||||
private Language _desiredTitleLanguage;
|
||||
private CancellationTokenSource _cancellationToken;
|
||||
private bool _isLoading;
|
||||
|
||||
private static readonly ApplicationJsonSerializerContext _serializerContext = new(JsonHelper.GetDefaultSerializerOptions());
|
||||
private static readonly TitleUpdateMetadataJsonSerializerContext _titleSerializerContext = new(JsonHelper.GetDefaultSerializerOptions());
|
||||
|
@ -89,6 +90,28 @@ namespace Ryujinx.UI.App.Common
|
|||
}
|
||||
|
||||
public void LoadApplications(List<string> appDirs, Language desiredTitleLanguage)
|
||||
{
|
||||
if (_isLoading)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
_isLoading = true;
|
||||
|
||||
Thread applicationLibraryThread = new(() =>
|
||||
{
|
||||
LoadApplicationsReal(appDirs, desiredTitleLanguage);
|
||||
|
||||
_isLoading = false;
|
||||
})
|
||||
{
|
||||
Name = "GUI.ApplicationLibraryThread",
|
||||
IsBackground = true,
|
||||
};
|
||||
applicationLibraryThread.Start();
|
||||
}
|
||||
|
||||
private void LoadApplicationsReal(List<string> appDirs, Language desiredTitleLanguage)
|
||||
{
|
||||
int numApplicationsFound = 0;
|
||||
int numApplicationsLoaded = 0;
|
||||
|
|
|
@ -108,15 +108,15 @@
|
|||
</Style>
|
||||
<Style Selector="ui|SymbolIcon.gridNormal">
|
||||
<Setter Property="FontSize"
|
||||
Value="130" />
|
||||
Value="120" />
|
||||
</Style>
|
||||
<Style Selector="ui|SymbolIcon.gridLarge">
|
||||
<Setter Property="FontSize"
|
||||
Value="140" />
|
||||
Value="160" />
|
||||
</Style>
|
||||
<Style Selector="ui|SymbolIcon.gridHuge">
|
||||
<Setter Property="FontSize"
|
||||
Value="180" />
|
||||
Value="200" />
|
||||
</Style>
|
||||
<Style Selector="#TitleBarHost > Image">
|
||||
<Setter Property="Margin"
|
||||
|
|
|
@ -35,8 +35,6 @@ namespace Ryujinx.Ava.UI.Windows
|
|||
{
|
||||
internal static MainWindowViewModel MainWindowViewModel { get; private set; }
|
||||
|
||||
private bool _isLoading;
|
||||
|
||||
private UserChannelPersistence _userChannelPersistence;
|
||||
private static bool _deferLoad;
|
||||
private static string _launchPath;
|
||||
|
@ -534,39 +532,22 @@ namespace Ryujinx.Ava.UI.Windows
|
|||
|
||||
private void ReloadGameList()
|
||||
{
|
||||
if (_isLoading)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
_isLoading = true;
|
||||
|
||||
if (ViewModel.IsInFolder && !ConfigurationState.Instance.UI.UseSystemGameFolders)
|
||||
{
|
||||
ViewModel.PathHistory.Clear();
|
||||
ViewModel.IsInFolder = false;
|
||||
}
|
||||
|
||||
Thread applicationLibraryThread = new(() =>
|
||||
if (ViewModel.IsInFolder)
|
||||
{
|
||||
if (ViewModel.IsInFolder)
|
||||
{
|
||||
List<string> SearchPaths = new();
|
||||
SearchPaths.Add(ViewModel.PathHistory.Peek());
|
||||
ApplicationLibrary.LoadApplications(SearchPaths, ConfigurationState.Instance.System.Language);
|
||||
}
|
||||
else
|
||||
{
|
||||
ApplicationLibrary.LoadApplications(ConfigurationState.Instance.UI.GameDirs, ConfigurationState.Instance.System.Language);
|
||||
}
|
||||
|
||||
_isLoading = false;
|
||||
})
|
||||
List<string> SearchPaths = new();
|
||||
SearchPaths.Add(ViewModel.PathHistory.Peek());
|
||||
ApplicationLibrary.LoadApplications(SearchPaths, ConfigurationState.Instance.System.Language);
|
||||
}
|
||||
else
|
||||
{
|
||||
Name = "GUI.ApplicationLibraryThread",
|
||||
IsBackground = true,
|
||||
};
|
||||
applicationLibraryThread.Start();
|
||||
ApplicationLibrary.LoadApplications(ConfigurationState.Instance.UI.GameDirs, ConfigurationState.Instance.System.Language);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue