diff --git a/src/KeyKeeper/Views/CreateVaultDialog.axaml b/src/KeyKeeper/Views/CreateVaultDialog.axaml
index ec10c2e..b06dc96 100644
--- a/src/KeyKeeper/Views/CreateVaultDialog.axaml
+++ b/src/KeyKeeper/Views/CreateVaultDialog.axaml
@@ -3,91 +3,92 @@
x:Class="KeyKeeper.Views.CreateVaultFileWindow"
Title="Create New Vault"
Background="#fff"
+ Focusable="True"
Icon="/Assets/icon.ico"
Width="600" Height="450"
WindowStartupLocation="CenterOwner"
CanResize="False"
x:Name="ThisWindow">
-
-
-
-
-
+
+
+
+
-
-
+
+
-
-
-
-
+
+
+
-
-
-
-
-
+
+
+
+
-
-
-
+
-
+
-
-
-
-
+
+
+
-
+
-
-
-
+
+
-
+
-
-
+
-
-
-
-
-
+
+
+
+
diff --git a/src/KeyKeeper/Views/CreateVaultDialog.axaml.cs b/src/KeyKeeper/Views/CreateVaultDialog.axaml.cs
index 4f908ab..4295698 100644
--- a/src/KeyKeeper/Views/CreateVaultDialog.axaml.cs
+++ b/src/KeyKeeper/Views/CreateVaultDialog.axaml.cs
@@ -1,9 +1,8 @@
using Avalonia;
using Avalonia.Controls;
+using Avalonia.Input;
using Avalonia.Interactivity;
using Avalonia.Platform.Storage;
-using System;
-using System.Threading.Tasks;
namespace KeyKeeper.Views
{
@@ -22,6 +21,8 @@ namespace KeyKeeper.Views
FilePathTextBox.TextChanged += OnTextChanged;
PasswordBox.TextChanged += OnPasswordTextChanged;
ConfirmPasswordBox.TextChanged += OnPasswordTextChanged;
+
+ KeyDown += CreateVaultDialog_KeyDown;
}
private async void OnTextChanged(object? sender, TextChangedEventArgs e)
@@ -60,6 +61,18 @@ namespace KeyKeeper.Views
CreateButton.IsEnabled = pathValid && passwordsEntered;
}
+ private void CreateVaultDialog_KeyDown(object? sender, KeyEventArgs e)
+ {
+ if (e.Key == Key.Escape)
+ {
+ Close();
+ }
+ else if (e.Key == Key.Enter && CreateButton.IsEnabled)
+ {
+ Submit();
+ }
+ }
+
private async void BrowseButton_Click(object? sender, RoutedEventArgs e)
{
var file = await StorageProvider.SaveFilePickerAsync(new FilePickerSaveOptions
@@ -83,6 +96,11 @@ namespace KeyKeeper.Views
}
private void CreateButton_Click(object? sender, RoutedEventArgs e)
+ {
+ Submit();
+ }
+
+ private void Submit()
{
string path = FilePathTextBox.Text ?? "";
if (string.IsNullOrWhiteSpace(path))
diff --git a/src/KeyKeeper/Views/RepositoryWindow.axaml b/src/KeyKeeper/Views/RepositoryWindow.axaml
index e3c14ac..beb6734 100644
--- a/src/KeyKeeper/Views/RepositoryWindow.axaml
+++ b/src/KeyKeeper/Views/RepositoryWindow.axaml
@@ -4,7 +4,7 @@
xmlns:i="using:Avalonia.Interactivity"
xmlns:kkp="using:KeyKeeper.Views"
x:Class="KeyKeeper.Views.RepositoryWindow"
- Closing="RepositoryWindow_Closing"
+ Closing="RepositoryWindow_Closing"
Title="KeyKeeper - Password store"
CanResize="False"
Width="800"
@@ -12,17 +12,19 @@
Background="White"
x:DataType="vm:RepositoryWindowViewModel">
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
-
-
-
-
- -->
+
+
-
-
-
+
+
-
-
-
-
-
-
-
+
+
+
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
+
+
+
-
-
+
-
-
-
-
-
-
-
+
+
+
+
+
-
-
-
+
+
+
-
+