mirror of
https://git.naxdy.org/Mirror/Ryujinx.git
synced 2025-01-09 12:19:12 +00:00
Hide back button when folders are disabled, reload game list when the folder setting is changed
This commit is contained in:
parent
1ef15e5107
commit
7761382740
4 changed files with 32 additions and 3 deletions
|
@ -86,6 +86,7 @@ namespace Ryujinx.Ava.UI.ViewModels
|
|||
private string _lastScannedAmiiboId;
|
||||
private bool _statusBarVisible;
|
||||
private bool _isInFolder;
|
||||
private bool _foldersEnabled;
|
||||
private ReadOnlyObservableCollection<ApplicationData> _appsObservableList;
|
||||
|
||||
private string _showUiKey = "F4";
|
||||
|
@ -123,6 +124,7 @@ namespace Ryujinx.Ava.UI.ViewModels
|
|||
|
||||
_rendererWaitEvent = new AutoResetEvent(false);
|
||||
_pathHistory = new Stack<string>();
|
||||
FoldersEnabled = ConfigurationState.Instance.UI.UseSystemGameFolders;
|
||||
|
||||
if (Program.PreviewerDetached)
|
||||
{
|
||||
|
@ -683,6 +685,16 @@ namespace Ryujinx.Ava.UI.ViewModels
|
|||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
public bool FoldersEnabled
|
||||
{
|
||||
get => _foldersEnabled;
|
||||
set
|
||||
{
|
||||
_foldersEnabled = value;
|
||||
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
internal void Sort(bool isAscending)
|
||||
{
|
||||
|
|
|
@ -116,6 +116,7 @@ namespace Ryujinx.Ava.UI.ViewModels
|
|||
|
||||
public bool IsHypervisorAvailable => OperatingSystem.IsMacOS() && RuntimeInformation.ProcessArchitecture == Architecture.Arm64;
|
||||
|
||||
public bool FolderModeChanged;
|
||||
public bool DirectoryChanged
|
||||
{
|
||||
get => _directoryChanged;
|
||||
|
@ -491,7 +492,6 @@ namespace Ryujinx.Ava.UI.ViewModels
|
|||
config.EnableDiscordIntegration.Value = EnableDiscordIntegration;
|
||||
config.CheckUpdatesOnStart.Value = CheckUpdatesOnStart;
|
||||
config.ShowConfirmExit.Value = ShowConfirmExit;
|
||||
config.UI.UseSystemGameFolders.Value = UseSystemGameFolders;
|
||||
config.HideCursor.Value = (HideCursorMode)HideCursor;
|
||||
|
||||
if (_directoryChanged)
|
||||
|
@ -500,6 +500,12 @@ namespace Ryujinx.Ava.UI.ViewModels
|
|||
config.UI.GameDirs.Value = gameDirs;
|
||||
}
|
||||
|
||||
if (UseSystemGameFolders != config.UI.UseSystemGameFolders.Value)
|
||||
{
|
||||
FolderModeChanged = true;
|
||||
}
|
||||
config.UI.UseSystemGameFolders.Value = UseSystemGameFolders;
|
||||
|
||||
config.UI.BaseStyle.Value = BaseStyleIndex == 0 ? "Light" : "Dark";
|
||||
|
||||
// Input
|
||||
|
@ -590,6 +596,7 @@ namespace Ryujinx.Ava.UI.ViewModels
|
|||
SaveSettingsEvent?.Invoke();
|
||||
|
||||
_directoryChanged = false;
|
||||
FolderModeChanged = false;
|
||||
}
|
||||
|
||||
private static void RevertIfNotSaved()
|
||||
|
|
|
@ -24,6 +24,7 @@
|
|||
Margin="5,2,0,2"
|
||||
VerticalAlignment="Stretch"
|
||||
Command="{Binding NavigateBack}"
|
||||
IsVisible="{Binding FoldersEnabled}"
|
||||
IsEnabled="{Binding IsInFolder}">
|
||||
<ui:FontIcon
|
||||
Margin="0"
|
||||
|
|
|
@ -39,9 +39,18 @@ namespace Ryujinx.Ava.UI.Windows
|
|||
{
|
||||
InputPage.ControllerSettings?.SaveCurrentProfile();
|
||||
|
||||
if (Owner is MainWindow window && ViewModel.DirectoryChanged)
|
||||
if (Owner is MainWindow window)
|
||||
{
|
||||
window.LoadApplications();
|
||||
if (ViewModel.DirectoryChanged)
|
||||
{
|
||||
window.LoadApplications();
|
||||
}
|
||||
|
||||
if (ViewModel.FolderModeChanged)
|
||||
{
|
||||
window.LoadApplications();
|
||||
window.ViewModel.FoldersEnabled = ViewModel.UseSystemGameFolders;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue