diff --git a/src/KeyKeeper/Views/CreateVaultDialog.axaml b/src/KeyKeeper/Views/CreateVaultDialog.axaml
index ec10c2e..fe07713 100644
--- a/src/KeyKeeper/Views/CreateVaultDialog.axaml
+++ b/src/KeyKeeper/Views/CreateVaultDialog.axaml
@@ -1,93 +1,94 @@
-
-
-
-
-
+
+
+
+
-
-
+
+
-
-
-
-
+
+
+
-
-
-
-
-
+
+
+
+
-
-
-
+
-
+
-
-
-
-
+
+
+
-
+
-
-
-
+
+
-
+
-
-
+
-
-
-
-
-
+
+
+
+
diff --git a/src/KeyKeeper/Views/CreateVaultDialog.axaml.cs b/src/KeyKeeper/Views/CreateVaultDialog.axaml.cs
index 4f908ab..3e62fb3 100644
--- a/src/KeyKeeper/Views/CreateVaultDialog.axaml.cs
+++ b/src/KeyKeeper/Views/CreateVaultDialog.axaml.cs
@@ -1,19 +1,18 @@
using Avalonia;
using Avalonia.Controls;
+using Avalonia.Input;
using Avalonia.Interactivity;
using Avalonia.Platform.Storage;
-using System;
-using System.Threading.Tasks;
namespace KeyKeeper.Views
{
- public partial class CreateVaultFileWindow : Window
+ public partial class CreateVaultDialog : Window
{
public string FilePath { get; private set; } = string.Empty;
public string Password { get; private set; } = string.Empty;
public bool Success { get; private set; }
- public CreateVaultFileWindow()
+ public CreateVaultDialog()
{
InitializeComponent();
#if DEBUG
@@ -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/EntryEditWindow.axaml b/src/KeyKeeper/Views/EntryEditWindow.axaml
index 7274990..3bdf1c3 100644
--- a/src/KeyKeeper/Views/EntryEditWindow.axaml
+++ b/src/KeyKeeper/Views/EntryEditWindow.axaml
@@ -4,30 +4,30 @@
x:Class="KeyKeeper.Views.EntryEditWindow"
Title="Add Entry"
CanResize="False"
- Width="540"
- Height="300"
+ Width="400"
+ Height="250"
Background="White">
-
+
+ Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" Margin="0,0,0,20"/>
+ Grid.Row="1" Grid.Column="0" Margin="5" />
+ Grid.Row="2" Grid.Column="0" Margin="5" />
+ Grid.Row="3" Grid.Column="0" Margin="5" />
-
+
-
+
@@ -37,10 +37,10 @@
CornerRadius="2" />
-
-
+
+
@@ -50,12 +50,5 @@
-
-
\ No newline at end of file
diff --git a/src/KeyKeeper/Views/MainWindow.axaml b/src/KeyKeeper/Views/MainWindow.axaml
index 00b2174..5f2cd54 100644
--- a/src/KeyKeeper/Views/MainWindow.axaml
+++ b/src/KeyKeeper/Views/MainWindow.axaml
@@ -56,7 +56,7 @@
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+ VerticalAlignment="Center"
+ Width="13" Height="13"
+ Stretch="Uniform"
+ Data="M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2zm-6 9c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2zm3.1-9H8.9V6c0-1.71 1.39-3.1 3.1-3.1 1.71 0 3.1 1.39 3.1 3.1v2z"/>
+
+ Foreground="White"
+ FontSize="13"
+ FontWeight="SemiBold"
+ VerticalAlignment="Center"/>
-
-
+
@@ -75,93 +76,104 @@
HorizontalAlignment="Left"
Margin="0,20,0,0"/>
-
-
+
+
-
-
-
+
+
+
+
-
-
+
-
-
-
-
-
+ SelectionMode="Single"
+ KeyDown="PasswordsListBox_KeyDown">
-
-
-
-
+
+
+
+
+
+
+
+
+
+
-
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
+
+
+
-
-
+
-
-
+ Width="450"
+ Loaded="UnlockPasswordEdit_Loaded">
-
+
+
+
+
+
-
-
-
+
+
+
-
+
diff --git a/src/KeyKeeper/Views/RepositoryWindow.axaml.cs b/src/KeyKeeper/Views/RepositoryWindow.axaml.cs
index 6e39894..470f1f7 100644
--- a/src/KeyKeeper/Views/RepositoryWindow.axaml.cs
+++ b/src/KeyKeeper/Views/RepositoryWindow.axaml.cs
@@ -39,6 +39,11 @@ public partial class RepositoryWindow : Window
vm.ResetLockTimer();
}
+ private void UnlockPasswordEdit_Loaded(object? sender, RoutedEventArgs e)
+ {
+ (sender as TextBox)?.Focus();
+ }
+
private async void RepositoryWindow_Closing(object? sender, WindowClosingEventArgs e)
{
if (allowClose || closeConfirmationShown)
@@ -150,6 +155,18 @@ public partial class RepositoryWindow : Window
}
}
+ private void PasswordsListBox_KeyDown(object sender, KeyEventArgs args)
+ {
+ if (args.Key == Key.C && args.KeyModifiers == KeyModifiers.Control)
+ {
+ if (sender is ListBox list && list.SelectedItem is PassStoreEntryPassword pwd)
+ {
+ Clipboard!.SetTextAsync(pwd.Password.Value);
+ this.FindControlRecursive("NotificationHost")?.Show("Password copied to clipboard");
+ }
+ }
+ }
+
private async void EntryContextMenuItem_Click(object sender, RoutedEventArgs args)
{
if (args.Source is StyledElement s && s.DataContext is PassStoreEntryPassword pwd)