Avalonia - Use content dialog for user profile manager (#3455)
* remove content dialog placeholder from all windows * remove redundant window argument * redesign user profile window * wip * use avalonia auto name generator * add edit and new user options * move profile image selection to content dialog * remove usings * fix updater * address review * adjust avatar dialog size * add validation for user editor * fix typo * Shorten some labels
This commit is contained in:
parent
3a3380fa25
commit
6e02cac952
46 changed files with 968 additions and 953 deletions
|
@ -13,7 +13,7 @@ using System.Threading.Tasks;
|
|||
|
||||
namespace Ryujinx.Ava.Ui.Controls
|
||||
{
|
||||
internal class SwkbdAppletDialog : UserControl
|
||||
internal partial class SwkbdAppletDialog : UserControl
|
||||
{
|
||||
private Predicate<int> _checkLength;
|
||||
private int _inputMax;
|
||||
|
@ -30,6 +30,10 @@ namespace Ryujinx.Ava.Ui.Controls
|
|||
_placeholder = placeholder;
|
||||
InitializeComponent();
|
||||
|
||||
Input.Watermark = _placeholder;
|
||||
|
||||
Input.AddHandler(TextInputEvent, Message_TextInput, RoutingStrategies.Tunnel, true);
|
||||
|
||||
SetInputLengthValidation(0, int.MaxValue); // Disable by default.
|
||||
}
|
||||
|
||||
|
@ -43,23 +47,9 @@ namespace Ryujinx.Ava.Ui.Controls
|
|||
public string MainText { get; set; } = "";
|
||||
public string SecondaryText { get; set; } = "";
|
||||
|
||||
public TextBlock Error { get; private set; }
|
||||
public TextBox Input { get; set; }
|
||||
|
||||
private void InitializeComponent()
|
||||
{
|
||||
AvaloniaXamlLoader.Load(this);
|
||||
Error = this.FindControl<TextBlock>("Error");
|
||||
Input = this.FindControl<TextBox>("Input");
|
||||
|
||||
Input.Watermark = _placeholder;
|
||||
|
||||
Input.AddHandler(TextInputEvent, Message_TextInput, RoutingStrategies.Tunnel, true);
|
||||
}
|
||||
|
||||
public static async Task<(UserResult Result, string Input)> ShowInputDialog(StyleableWindow window, string title, SoftwareKeyboardUiArgs args)
|
||||
{
|
||||
ContentDialog contentDialog = window.ContentDialog;
|
||||
ContentDialog contentDialog = new ContentDialog();
|
||||
|
||||
UserResult result = UserResult.Cancel;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue