aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Ava/UI/Controls
diff options
context:
space:
mode:
Diffstat (limited to 'Ryujinx.Ava/UI/Controls')
-rw-r--r--Ryujinx.Ava/UI/Controls/InputDialog.axaml32
-rw-r--r--Ryujinx.Ava/UI/Controls/InputDialog.axaml.cs57
-rw-r--r--Ryujinx.Ava/UI/Controls/UpdateWaitWindow.axaml.cs11
3 files changed, 11 insertions, 89 deletions
diff --git a/Ryujinx.Ava/UI/Controls/InputDialog.axaml b/Ryujinx.Ava/UI/Controls/InputDialog.axaml
deleted file mode 100644
index ed1ceda3..00000000
--- a/Ryujinx.Ava/UI/Controls/InputDialog.axaml
+++ /dev/null
@@ -1,32 +0,0 @@
-<UserControl
- x:Class="Ryujinx.Ava.UI.Controls.InputDialog"
- xmlns="https://github.com/avaloniaui"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
- xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
- mc:Ignorable="d"
- Focusable="True">
- <Grid
- Margin="5,10,5,5"
- HorizontalAlignment="Stretch"
- VerticalAlignment="Center">
- <Grid.RowDefinitions>
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- </Grid.RowDefinitions>
- <TextBlock HorizontalAlignment="Center" Text="{Binding Message}" />
- <TextBox
- Grid.Row="1"
- Width="300"
- Margin="10"
- HorizontalAlignment="Center"
- MaxLength="{Binding MaxLength}"
- Text="{Binding Input, Mode=TwoWay}" />
- <TextBlock
- Grid.Row="2"
- Margin="5,5,5,10"
- HorizontalAlignment="Center"
- Text="{Binding SubMessage}" />
- </Grid>
-</UserControl> \ No newline at end of file
diff --git a/Ryujinx.Ava/UI/Controls/InputDialog.axaml.cs b/Ryujinx.Ava/UI/Controls/InputDialog.axaml.cs
deleted file mode 100644
index 8dba5e2b..00000000
--- a/Ryujinx.Ava/UI/Controls/InputDialog.axaml.cs
+++ /dev/null
@@ -1,57 +0,0 @@
-using Avalonia.Controls;
-using FluentAvalonia.UI.Controls;
-using Ryujinx.Ava.Common.Locale;
-using Ryujinx.Ava.UI.Helpers;
-using Ryujinx.Ava.UI.Models;
-using System.Threading.Tasks;
-
-namespace Ryujinx.Ava.UI.Controls
-{
- public partial class InputDialog : UserControl
- {
- public string Message { get; set; }
- public string Input { get; set; }
- public string SubMessage { get; set; }
-
- public uint MaxLength { get; }
-
- public InputDialog(string message, string input = "", string subMessage = "", uint maxLength = int.MaxValue)
- {
- Message = message;
- Input = input;
- SubMessage = subMessage;
- MaxLength = maxLength;
-
- DataContext = this;
- }
-
- public InputDialog()
- {
- InitializeComponent();
- }
-
- public static async Task<(UserResult Result, string Input)> ShowInputDialog(string title, string message,
- string input = "", string subMessage = "", uint maxLength = int.MaxValue)
- {
- UserResult result = UserResult.Cancel;
-
- InputDialog content = new InputDialog(message, input, subMessage, maxLength);
- ContentDialog contentDialog = new ContentDialog
- {
- Title = title,
- PrimaryButtonText = LocaleManager.Instance[LocaleKeys.InputDialogOk],
- SecondaryButtonText = "",
- CloseButtonText = LocaleManager.Instance[LocaleKeys.InputDialogCancel],
- Content = content,
- PrimaryButtonCommand = MiniCommand.Create(() =>
- {
- result = UserResult.Ok;
- input = content.Input;
- })
- };
- await contentDialog.ShowAsync();
-
- return (result, input);
- }
- }
-} \ No newline at end of file
diff --git a/Ryujinx.Ava/UI/Controls/UpdateWaitWindow.axaml.cs b/Ryujinx.Ava/UI/Controls/UpdateWaitWindow.axaml.cs
index 9db7b5d4..80a437e3 100644
--- a/Ryujinx.Ava/UI/Controls/UpdateWaitWindow.axaml.cs
+++ b/Ryujinx.Ava/UI/Controls/UpdateWaitWindow.axaml.cs
@@ -1,15 +1,26 @@
using Avalonia.Controls;
using Ryujinx.Ava.UI.Windows;
+using System.Threading;
namespace Ryujinx.Ava.UI.Controls
{
public partial class UpdateWaitWindow : StyleableWindow
{
+ public UpdateWaitWindow(string primaryText, string secondaryText, CancellationTokenSource cancellationToken) : this(primaryText, secondaryText)
+ {
+ SystemDecorations = SystemDecorations.Full;
+ ShowInTaskbar = true;
+
+ Closing += (_, _) => cancellationToken.Cancel();
+ }
+
public UpdateWaitWindow(string primaryText, string secondaryText) : this()
{
PrimaryText.Text = primaryText;
SecondaryText.Text = secondaryText;
WindowStartupLocation = WindowStartupLocation.CenterOwner;
+ SystemDecorations = SystemDecorations.BorderOnly;
+ ShowInTaskbar = false;
}
public UpdateWaitWindow()