Added new option "exit by pressing plus and minus buttons" to the input section.

This commit is contained in:
Vova
2025-01-08 21:43:18 +10:00
parent 007d3bc045
commit 37b4dd2133
24 changed files with 333 additions and 25 deletions

View File

@@ -45,6 +45,7 @@ namespace Ryujinx.Ava.UI.Windows
internal readonly AvaHostUIHandler UiHandler;
private bool _isLoading;
private bool _isExitWithoutConfirm = false;
private bool _applicationsLoadedOnce;
private UserChannelPersistence _userChannelPersistence;
@@ -574,11 +575,11 @@ namespace Ryujinx.Ava.UI.Windows
protected override void OnClosing(WindowClosingEventArgs e)
{
if (!ViewModel.IsClosing && ViewModel.AppHost != null && ConfigurationState.Instance.ShowConfirmExit)
if (!ViewModel.IsClosing && ViewModel.AppHost != null && ConfigurationState.Instance.ShowConfirmExit && !_isExitWithoutConfirm)
{
e.Cancel = true;
ConfirmExit();
ConfirmExit();
return;
}
@@ -619,6 +620,12 @@ namespace Ryujinx.Ava.UI.Windows
base.OnClosing(e);
}
public void ForceExit() {
_isExitWithoutConfirm = true;
Close();
}
private void ConfirmExit()
{
Dispatcher.UIThread.InvokeAsync(async () =>