close on Esc

This commit is contained in:
Alen Šiljak 2025-05-01 20:58:33 +02:00
parent 92f215d039
commit ab561ef330

View file

@ -1,4 +1,5 @@
using Avalonia.Controls; using Avalonia.Controls;
using Avalonia.Input;
using Avalonia.Interactivity; using Avalonia.Interactivity;
using Avalonia.Platform.Storage; using Avalonia.Platform.Storage;
@ -33,5 +34,13 @@ namespace SourceGit.Views
e.Handled = true; e.Handled = true;
} }
protected override void OnKeyDown(KeyEventArgs e)
{
base.OnKeyDown(e);
if (!e.Handled && e.Key == Key.Escape)
Close();
}
} }
} }