mirror of
https://github.com/KeyKeeperApp/KeyKeeper.git
synced 2026-05-04 05:46:29 +03:00
implement password copy to clipboard
This commit is contained in:
@@ -30,7 +30,7 @@ public partial class EntryEditWindow: Window
|
||||
if (password.Length == 0) return;
|
||||
|
||||
EditedEntry = new PassStoreEntryPassword(
|
||||
new Guid(),
|
||||
Guid.NewGuid(),
|
||||
DateTime.UtcNow,
|
||||
DateTime.UtcNow,
|
||||
Guid.Empty,
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<Window xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:vm="using:KeyKeeper.ViewModels"
|
||||
xmlns:i="using:Avalonia.Interactivity"
|
||||
x:Class="KeyKeeper.Views.RepositoryWindow"
|
||||
Title="KeyKeeper - Password store"
|
||||
CanResize="False"
|
||||
@@ -69,12 +70,17 @@
|
||||
|
||||
<ListBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<StackPanel Width="100" Margin="10" HorizontalAlignment="Center">
|
||||
<Svg Path="/Assets/logo_en.svg" Width="48" Height="48"/>
|
||||
<TextBlock Text="{Binding Name}"
|
||||
HorizontalAlignment="Center"
|
||||
Foreground="Black" />
|
||||
</StackPanel>
|
||||
<Border Background="Transparent" DoubleTapped="Entry_DoubleTapped">
|
||||
<StackPanel Width="100"
|
||||
Margin="10"
|
||||
HorizontalAlignment="Center">
|
||||
<Svg Path="/Assets/logo_en.svg" Width="48" Height="48"
|
||||
/>
|
||||
<TextBlock Text="{Binding Name}"
|
||||
HorizontalAlignment="Center"
|
||||
Foreground="Black" />
|
||||
</StackPanel>
|
||||
</Border>
|
||||
</DataTemplate>
|
||||
</ListBox.ItemTemplate>
|
||||
</ListBox>
|
||||
|
||||
@@ -2,6 +2,7 @@ using System;
|
||||
using System.Threading.Tasks;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Interactivity;
|
||||
using KeyKeeper.PasswordStore;
|
||||
using KeyKeeper.ViewModels;
|
||||
|
||||
namespace KeyKeeper.Views;
|
||||
@@ -42,4 +43,13 @@ public partial class RepositoryWindow: Window
|
||||
pageVm.Save();
|
||||
}
|
||||
}
|
||||
|
||||
private void Entry_DoubleTapped(object sender, RoutedEventArgs args)
|
||||
{
|
||||
if (args.Source is Border b)
|
||||
{
|
||||
if (b.DataContext is PassStoreEntryPassword pwd)
|
||||
Clipboard!.SetTextAsync(pwd.Password.Value);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user