Press the Esc button to close the window

https://github.com/2dust/v2rayN/issues/7819
This commit is contained in:
2dust
2025-08-23 16:23:30 +08:00
parent bb4f33559f
commit 606b216cd0
6 changed files with 37 additions and 0 deletions
@@ -1,5 +1,6 @@
using System.Reactive.Disposables;
using Avalonia.Controls;
using Avalonia.Interactivity;
using ReactiveUI;
using ServiceLib.Manager;
using v2rayN.Desktop.Base;
@@ -14,6 +15,7 @@ public partial class OptionSettingWindow : WindowBase<OptionSettingViewModel>
{
InitializeComponent();
Loaded += Window_Loaded;
btnCancel.Click += (s, e) => this.Close();
_config = AppManager.Instance.Config;
@@ -209,4 +211,8 @@ public partial class OptionSettingWindow : WindowBase<OptionSettingViewModel>
ViewModel.destOverride = clbdestOverride.SelectedItems.Cast<string>().ToList();
}
}
private void Window_Loaded(object? sender, RoutedEventArgs e)
{
btnCancel.Focus();
}
}