mirror of
https://github.com/2dust/v2rayN.git
synced 2026-11-07 21:15:01 +03:00
fix(desktop): 删除确认对话框打开时聚焦确认按钮 (#10542)
对话框弹出后键盘焦点仍停留在主列表,回车会触发列表的 SetDefaultServer 而不是确认按钮。在 MessageBoxDialog 打开时将焦点移到确认按钮,确保回车只确认对话框。
This commit is contained in:
@@ -25,9 +25,16 @@ public partial class MessageBoxDialog : Window
|
||||
btnYes.Click += BtnYes_Click;
|
||||
btnNo.Click += BtnNo_Click;
|
||||
|
||||
Opened += MessageBoxDialog_Opened;
|
||||
|
||||
CanMinimize = false;
|
||||
}
|
||||
|
||||
private void MessageBoxDialog_Opened(object? sender, EventArgs e)
|
||||
{
|
||||
btnYes.Focus();
|
||||
}
|
||||
|
||||
private void BtnYes_Click(object? sender, RoutedEventArgs e)
|
||||
{
|
||||
Close(ButtonResult.Yes);
|
||||
|
||||
Reference in New Issue
Block a user