feat(UI/6890): fix formatting

This commit is contained in:
Jean-Philippe HAUTIN 2024-06-04 14:58:16 +02:00
commit c33bdbeff1
5 changed files with 17 additions and 17 deletions

View file

@ -324,7 +324,7 @@ namespace Ryujinx
{ {
mainWindow.ShowProfilesSelector(); mainWindow.ShowProfilesSelector();
} }
if (CommandLineState.LaunchPathArg != null) if (CommandLineState.LaunchPathArg != null)
{ {
mainWindow.RunApplication(CommandLineState.LaunchPathArg, CommandLineState.StartFullscreenArg); mainWindow.RunApplication(CommandLineState.LaunchPathArg, CommandLineState.StartFullscreenArg);

View file

@ -106,11 +106,11 @@ namespace Ryujinx.UI.Windows
string userName = _tableStore.GetValue(selectedIter, 2).ToString().Split("\n")[0]; string userName = _tableStore.GetValue(selectedIter, 2).ToString().Split("\n")[0];
string userId = _tableStore.GetValue(selectedIter, 2).ToString().Split("\n")[1]; string userId = _tableStore.GetValue(selectedIter, 2).ToString().Split("\n")[1];
// Open the selected one. // Open the selected one.
_accountManager.OpenUser(new UserId(userId)); _accountManager.OpenUser(new UserId(userId));
Close(); Close();
} }

View file

@ -10,28 +10,28 @@ namespace Ryujinx.Ava.UI.ViewModels
{ {
private UserProfile _selectedProfile; private UserProfile _selectedProfile;
public event Action CloseWindow; public event Action CloseWindow;
public event Action ApplyProfile; public event Action ApplyProfile;
public ProfilesViewModel() public ProfilesViewModel()
{ {
Profiles = new AvaloniaList<UserProfile>(); Profiles = new AvaloniaList<UserProfile>();
Profiles.Clear(); Profiles.Clear();
} }
public ProfilesViewModel(IEnumerable<UserProfile> profiles) public ProfilesViewModel(IEnumerable<UserProfile> profiles)
{ {
Profiles = new AvaloniaList<UserProfile>(); Profiles = new AvaloniaList<UserProfile>();
Profiles.Clear(); Profiles.Clear();
Profiles.AddRange(profiles); Profiles.AddRange(profiles);
} }
public AvaloniaList<UserProfile> Profiles public AvaloniaList<UserProfile> Profiles
{ {
get; set; get; set;
} }
public UserProfile SelectedProfile public UserProfile SelectedProfile
{ {
get => _selectedProfile; get => _selectedProfile;
@ -40,13 +40,13 @@ namespace Ryujinx.Ava.UI.ViewModels
_selectedProfile = value; _selectedProfile = value;
OnPropertyChanged(); OnPropertyChanged();
} }
} }
public void Close() public void Close()
{ {
CloseWindow?.Invoke(); CloseWindow?.Invoke();
GC.SuppressFinalize(this); GC.SuppressFinalize(this);
} }
} }
} }

View file

@ -26,9 +26,9 @@ namespace Ryujinx.Ava.UI.Views.User
ViewModel = new ProfilesViewModel(); ViewModel = new ProfilesViewModel();
var profiles = _accountManager var profiles = _accountManager
.GetAllUsers() .GetAllUsers()
.Select(p => new Models.UserProfile(p,null)) .Select(p => new Models.UserProfile(p, null))
.OrderBy(p => p.Name); .OrderBy(p => p.Name);
ViewModel.Profiles.AddRange(profiles); ViewModel.Profiles.AddRange(profiles);
InitializeComponent(); InitializeComponent();
} }
@ -67,7 +67,7 @@ namespace Ryujinx.Ava.UI.Views.User
{ {
if (ViewModel.Profiles[selectedIndex] is UserProfile userProfile) if (ViewModel.Profiles[selectedIndex] is UserProfile userProfile)
{ {
_accountManager?.OpenUser(userProfile.UserId); _accountManager?.OpenUser(userProfile.UserId);
foreach (BaseModel profile in ViewModel.Profiles) foreach (BaseModel profile in ViewModel.Profiles)
{ {

View file

@ -309,7 +309,7 @@ namespace Ryujinx.Ava.UI.Windows
DataContext = content.ViewModel, DataContext = content.ViewModel,
Content = content, Content = content,
Padding = new Thickness(0), Padding = new Thickness(0),
}; };
content.ViewModel.CloseWindow += contentDialog.Hide; content.ViewModel.CloseWindow += contentDialog.Hide;
Style footer = new(x => x.Name("DialogSpace").Child().OfType<Border>()); Style footer = new(x => x.Name("DialogSpace").Child().OfType<Border>());
footer.Setters.Add(new Setter(IsVisibleProperty, false)); footer.Setters.Add(new Setter(IsVisibleProperty, false));
@ -317,7 +317,7 @@ namespace Ryujinx.Ava.UI.Windows
contentDialog.Styles.Add(footer); contentDialog.Styles.Add(footer);
await contentDialog.ShowAsync(); await contentDialog.ShowAsync();
}); });
} }
private async Task CheckLaunchState() private async Task CheckLaunchState()