mirror of
https://github.com/2dust/v2rayN.git
synced 2026-11-18 18:35:00 +03:00
Press the Esc button to close the window
https://github.com/2dust/v2rayN/issues/7819
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
using System.Reactive.Disposables;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Input;
|
||||
using Avalonia.Interactivity;
|
||||
using DialogHostAvalonia;
|
||||
using DynamicData;
|
||||
@@ -20,6 +21,7 @@ public partial class SubSettingWindow : WindowBase<SubSettingViewModel>
|
||||
|
||||
menuClose.Click += menuClose_Click;
|
||||
this.Closing += SubSettingWindow_Closing;
|
||||
this.KeyDown += SubSettingWindow_KeyDown;
|
||||
ViewModel = new SubSettingViewModel(UpdateViewHandler);
|
||||
lstSubscription.DoubleTapped += LstSubscription_DoubleTapped;
|
||||
lstSubscription.SelectionChanged += LstSubscription_SelectionChanged;
|
||||
@@ -106,4 +108,12 @@ public partial class SubSettingWindow : WindowBase<SubSettingViewModel>
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void SubSettingWindow_KeyDown(object? sender, KeyEventArgs e)
|
||||
{
|
||||
if (e.Key == Key.Escape)
|
||||
{
|
||||
menuClose_Click(null, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user