mirror of
https://github.com/KeyKeeperApp/KeyKeeper.git
synced 2026-05-17 13:56:31 +03:00
make Ctrl+C on an entry copy its password
This commit is contained in:
@@ -100,7 +100,8 @@
|
|||||||
Margin="286 10 10 10"
|
Margin="286 10 10 10"
|
||||||
ItemsSource="{Binding Passwords}"
|
ItemsSource="{Binding Passwords}"
|
||||||
Background="Transparent"
|
Background="Transparent"
|
||||||
SelectionMode="Single">
|
SelectionMode="Single"
|
||||||
|
KeyDown="PasswordsListBox_KeyDown">
|
||||||
|
|
||||||
<ListBox.ItemsPanel>
|
<ListBox.ItemsPanel>
|
||||||
<ItemsPanelTemplate>
|
<ItemsPanelTemplate>
|
||||||
@@ -110,7 +111,8 @@
|
|||||||
|
|
||||||
<ListBox.ItemTemplate>
|
<ListBox.ItemTemplate>
|
||||||
<DataTemplate>
|
<DataTemplate>
|
||||||
<Border Background="Transparent" DoubleTapped="Entry_DoubleTapped">
|
<Border Background="Transparent"
|
||||||
|
DoubleTapped="Entry_DoubleTapped">
|
||||||
|
|
||||||
<StackPanel Width="100"
|
<StackPanel Width="100"
|
||||||
Margin="10"
|
Margin="10"
|
||||||
|
|||||||
@@ -155,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<ToastNotificationHost>("NotificationHost")?.Show("Password copied to clipboard");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private async void EntryContextMenuItem_Click(object sender, RoutedEventArgs args)
|
private async void EntryContextMenuItem_Click(object sender, RoutedEventArgs args)
|
||||||
{
|
{
|
||||||
if (args.Source is StyledElement s && s.DataContext is PassStoreEntryPassword pwd)
|
if (args.Source is StyledElement s && s.DataContext is PassStoreEntryPassword pwd)
|
||||||
|
|||||||
Reference in New Issue
Block a user