mirror of
https://git.naxdy.org/Mirror/Ryujinx.git
synced 2025-01-09 20:29:11 +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 readonly VirtualFileSystem _virtualFileSystem;
|
||||||
private Language _desiredTitleLanguage;
|
private Language _desiredTitleLanguage;
|
||||||
private CancellationTokenSource _cancellationToken;
|
private CancellationTokenSource _cancellationToken;
|
||||||
|
private bool _isLoading;
|
||||||
|
|
||||||
private static readonly ApplicationJsonSerializerContext _serializerContext = new(JsonHelper.GetDefaultSerializerOptions());
|
private static readonly ApplicationJsonSerializerContext _serializerContext = new(JsonHelper.GetDefaultSerializerOptions());
|
||||||
private static readonly TitleUpdateMetadataJsonSerializerContext _titleSerializerContext = 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)
|
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 numApplicationsFound = 0;
|
||||||
int numApplicationsLoaded = 0;
|
int numApplicationsLoaded = 0;
|
||||||
|
|
|
@ -108,15 +108,15 @@
|
||||||
</Style>
|
</Style>
|
||||||
<Style Selector="ui|SymbolIcon.gridNormal">
|
<Style Selector="ui|SymbolIcon.gridNormal">
|
||||||
<Setter Property="FontSize"
|
<Setter Property="FontSize"
|
||||||
Value="130" />
|
Value="120" />
|
||||||
</Style>
|
</Style>
|
||||||
<Style Selector="ui|SymbolIcon.gridLarge">
|
<Style Selector="ui|SymbolIcon.gridLarge">
|
||||||
<Setter Property="FontSize"
|
<Setter Property="FontSize"
|
||||||
Value="140" />
|
Value="160" />
|
||||||
</Style>
|
</Style>
|
||||||
<Style Selector="ui|SymbolIcon.gridHuge">
|
<Style Selector="ui|SymbolIcon.gridHuge">
|
||||||
<Setter Property="FontSize"
|
<Setter Property="FontSize"
|
||||||
Value="180" />
|
Value="200" />
|
||||||
</Style>
|
</Style>
|
||||||
<Style Selector="#TitleBarHost > Image">
|
<Style Selector="#TitleBarHost > Image">
|
||||||
<Setter Property="Margin"
|
<Setter Property="Margin"
|
||||||
|
|
|
@ -35,8 +35,6 @@ namespace Ryujinx.Ava.UI.Windows
|
||||||
{
|
{
|
||||||
internal static MainWindowViewModel MainWindowViewModel { get; private set; }
|
internal static MainWindowViewModel MainWindowViewModel { get; private set; }
|
||||||
|
|
||||||
private bool _isLoading;
|
|
||||||
|
|
||||||
private UserChannelPersistence _userChannelPersistence;
|
private UserChannelPersistence _userChannelPersistence;
|
||||||
private static bool _deferLoad;
|
private static bool _deferLoad;
|
||||||
private static string _launchPath;
|
private static string _launchPath;
|
||||||
|
@ -534,39 +532,22 @@ namespace Ryujinx.Ava.UI.Windows
|
||||||
|
|
||||||
private void ReloadGameList()
|
private void ReloadGameList()
|
||||||
{
|
{
|
||||||
if (_isLoading)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
_isLoading = true;
|
|
||||||
|
|
||||||
if (ViewModel.IsInFolder && !ConfigurationState.Instance.UI.UseSystemGameFolders)
|
if (ViewModel.IsInFolder && !ConfigurationState.Instance.UI.UseSystemGameFolders)
|
||||||
{
|
{
|
||||||
ViewModel.PathHistory.Clear();
|
ViewModel.PathHistory.Clear();
|
||||||
ViewModel.IsInFolder = false;
|
ViewModel.IsInFolder = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
Thread applicationLibraryThread = new(() =>
|
if (ViewModel.IsInFolder)
|
||||||
{
|
{
|
||||||
if (ViewModel.IsInFolder)
|
List<string> SearchPaths = new();
|
||||||
{
|
SearchPaths.Add(ViewModel.PathHistory.Peek());
|
||||||
List<string> SearchPaths = new();
|
ApplicationLibrary.LoadApplications(SearchPaths, ConfigurationState.Instance.System.Language);
|
||||||
SearchPaths.Add(ViewModel.PathHistory.Peek());
|
}
|
||||||
ApplicationLibrary.LoadApplications(SearchPaths, ConfigurationState.Instance.System.Language);
|
else
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
ApplicationLibrary.LoadApplications(ConfigurationState.Instance.UI.GameDirs, ConfigurationState.Instance.System.Language);
|
|
||||||
}
|
|
||||||
|
|
||||||
_isLoading = false;
|
|
||||||
})
|
|
||||||
{
|
{
|
||||||
Name = "GUI.ApplicationLibraryThread",
|
ApplicationLibrary.LoadApplications(ConfigurationState.Instance.UI.GameDirs, ConfigurationState.Instance.System.Language);
|
||||||
IsBackground = true,
|
}
|
||||||
};
|
|
||||||
applicationLibraryThread.Start();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue