Move dialogues

This commit is contained in:
Isaac Marovitz 2024-07-16 12:18:20 +01:00
parent b041fd837c
commit 486a352de2
No known key found for this signature in database
GPG key ID: 97250B2B09A132E1
4 changed files with 29 additions and 12 deletions

View file

@ -74,17 +74,6 @@ namespace Ryujinx.Ava.UI.ViewModels
{
_graphicsBackendMultithreadingIndex = value;
if (_graphicsBackendMultithreadingIndex != (int)ConfigurationState.Instance.Graphics.BackendThreading.Value)
{
Dispatcher.UIThread.InvokeAsync(() =>
ContentDialogHelper.CreateInfoDialog(LocaleManager.Instance[LocaleKeys.DialogSettingsBackendThreadingWarningMessage],
"",
"",
LocaleManager.Instance[LocaleKeys.InputDialogOk],
LocaleManager.Instance[LocaleKeys.DialogSettingsBackendThreadingWarningTitle])
);
}
OnPropertyChanged();
}
}

View file

@ -34,7 +34,8 @@ namespace Ryujinx.Ava.UI.Views.Input
LocaleManager.Instance[LocaleKeys.DialogControllerSettingsModifiedConfirmSubMessage],
LocaleManager.Instance[LocaleKeys.InputDialogYes],
LocaleManager.Instance[LocaleKeys.InputDialogNo],
LocaleManager.Instance[LocaleKeys.RyujinxConfirm]);
LocaleManager.Instance[LocaleKeys.RyujinxConfirm],
parent: (Window)this.VisualRoot);
if (result == UserResult.Yes)
{

View file

@ -265,6 +265,7 @@
<ComboBox Width="350"
HorizontalContentAlignment="Left"
ToolTip.Tip="{locale:Locale GalThreadingTooltip}"
SelectionChanged="GraphicsBackendMultithreadingIndex_OnSelectionChanged"
SelectedIndex="{Binding GraphicsBackendMultithreadingIndex}">
<ComboBoxItem>
<TextBlock Text="{locale:Locale CommonAuto}" />

View file

@ -1,4 +1,10 @@
using Avalonia.Controls;
using Avalonia.Threading;
using Ryujinx.Ava.Common.Locale;
using Ryujinx.Ava.UI.Helpers;
using Ryujinx.Common.Logging;
using Ryujinx.UI.Common.Configuration;
using Logger = Ryujinx.Common.Logging.Logger;
namespace Ryujinx.Ava.UI.Views.Settings
{
@ -8,5 +14,25 @@ namespace Ryujinx.Ava.UI.Views.Settings
{
InitializeComponent();
}
private void GraphicsBackendMultithreadingIndex_OnSelectionChanged(object sender, SelectionChangedEventArgs e)
{
if (e.Source is not ComboBox comboBox)
{
return;
}
if (comboBox.SelectedIndex != (int)ConfigurationState.Instance.Graphics.BackendThreading.Value && comboBox.SelectedIndex >= 0)
{
Dispatcher.UIThread.InvokeAsync(() =>
ContentDialogHelper.CreateInfoDialog(LocaleManager.Instance[LocaleKeys.DialogSettingsBackendThreadingWarningMessage],
"",
"",
LocaleManager.Instance[LocaleKeys.InputDialogOk],
LocaleManager.Instance[LocaleKeys.DialogSettingsBackendThreadingWarningTitle],
parent: this.VisualRoot as Window)
);
}
}
}
}