Dynamic Window Titles + Clean Up Locales

This commit is contained in:
_Neo_ 2025-10-26 17:48:55 +02:00
parent 5d3f22ac57
commit 93256afd24
3 changed files with 86 additions and 261 deletions

View file

@ -166,7 +166,7 @@ namespace Ryujinx.Ava.UI.Controls
UserResult result = await ContentDialogHelper.CreateConfirmationDialog(
LocaleManager.Instance[LocaleKeys.DialogUserProfileDeletionConfirmMessage],
string.Empty,
LocaleManager.Instance[LocaleKeys.IrreversibleActionNote],
LocaleManager.Instance[LocaleKeys.InputDialogYes],
LocaleManager.Instance[LocaleKeys.InputDialogNo],
string.Empty);

View file

@ -17,10 +17,10 @@ namespace Ryujinx.Ava.UI.Views.User
private NavigationDialogHost _parent;
private UserProfile _profile;
private bool _isNewUser;
private readonly AccountManager _accountManager;
public static uint MaxProfileNameLength => 0x20;
public bool IsDeletable => _profile.UserId != AccountManager.DefaultUserId;
public string UserEditorTitle => LocaleManager.Instance.UpdateAndGetDynamicValue(LocaleKeys.UserEditorTitle, _profile.Name);
public UserEditorView()
{
InitializeComponent();
@ -47,7 +47,7 @@ namespace Ryujinx.Ava.UI.Views.User
}
((ContentDialog)_parent.Parent).Title = $"{LocaleManager.Instance[LocaleKeys.UserProfileWindowTitle]} - " +
$"{(_isNewUser ? LocaleManager.Instance[LocaleKeys.UserEditorTitleCreate] : LocaleManager.Instance[LocaleKeys.UserEditorTitle])}";
$"{(_isNewUser ? LocaleManager.Instance[LocaleKeys.UserEditorTitleNewUser] : UserEditorTitle)}";
AddPictureButton.IsVisible = _isNewUser;
ChangePictureButton.IsVisible = !_isNewUser;