From c529fab86945dc22b9badb5c75a89e2f92b116ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alen=20=C5=A0iljak?= <462445+alensiljak@users.noreply.github.com> Date: Sat, 3 May 2025 15:18:24 +0200 Subject: [PATCH] feature: close repository configuration dialog when user pressed `Esc` (#1269) --- src/Views/RepositoryConfigure.axaml.cs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/Views/RepositoryConfigure.axaml.cs b/src/Views/RepositoryConfigure.axaml.cs index 455731aa..2c80dd45 100644 --- a/src/Views/RepositoryConfigure.axaml.cs +++ b/src/Views/RepositoryConfigure.axaml.cs @@ -1,4 +1,5 @@ using Avalonia.Controls; +using Avalonia.Input; using Avalonia.Interactivity; using Avalonia.Platform.Storage; @@ -33,5 +34,13 @@ namespace SourceGit.Views e.Handled = true; } + + protected override void OnKeyDown(KeyEventArgs e) + { + base.OnKeyDown(e); + + if (!e.Handled && e.Key == Key.Escape) + Close(); + } } }