feat(UI/6890): fix formatting

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

View file

@ -324,7 +324,7 @@ namespace Ryujinx
{
mainWindow.ShowProfilesSelector();
}
if (CommandLineState.LaunchPathArg != null)
{
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 userId = _tableStore.GetValue(selectedIter, 2).ToString().Split("\n")[1];
// Open the selected one.
_accountManager.OpenUser(new UserId(userId));
Close();
}

View file

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

View file

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

View file

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