added button to refresh the buttons on the left in the menuview, to show new entries that were just made
This commit is contained in:
parent
6329e63310
commit
cd3822aaf8
@ -9,7 +9,8 @@
|
||||
<Style Selector="TextBlock">
|
||||
<Setter Property="FontSize" Value="16" />
|
||||
<Setter Property="Foreground" Value= "Gray" />
|
||||
<Setter Property="Margin" Value="0,10" />
|
||||
<Setter Property="Margin" Value="0,5" />
|
||||
<Setter Property="Padding" Value="0,8"/>
|
||||
</Style>
|
||||
<Style Selector="TextBox">
|
||||
<Setter Property="Height" Value="35" />
|
||||
@ -18,8 +19,8 @@
|
||||
<Setter Property="TextWrapping" Value="Wrap" />
|
||||
</Style>
|
||||
<Style Selector="Button.icon">
|
||||
<Setter Property="Width" Value="35" />
|
||||
<Setter Property="Height" Value="35" />
|
||||
<Setter Property="Width" Value="25" />
|
||||
<Setter Property="Height" Value="25" />
|
||||
<Setter Property="HorizontalContentAlignment" Value="Center" />
|
||||
<Setter Property="VerticalContentAlignment" Value="Center" />
|
||||
<Setter Property="CornerRadius" Value="4" />
|
||||
@ -40,18 +41,32 @@
|
||||
<StackPanel Margin="10" x:Name="entriesContainer" />
|
||||
</ScrollViewer>
|
||||
|
||||
<Button
|
||||
Background="Yellow"
|
||||
Content="↻"
|
||||
CornerRadius="22"
|
||||
FontSize="24"
|
||||
Foreground="White"
|
||||
Height="35"
|
||||
HorizontalAlignment="Left"
|
||||
IsEnabled="True"
|
||||
Margin="0,0,-50,20"
|
||||
VerticalAlignment="Bottom"
|
||||
Width="35"
|
||||
x:Name="RefreshButton"
|
||||
Click="RefreshButton_OnClick"/>
|
||||
<Button
|
||||
Background="Red"
|
||||
Content="-"
|
||||
CornerRadius="22"
|
||||
FontSize="24"
|
||||
Foreground="White"
|
||||
Height="45"
|
||||
Height="35"
|
||||
HorizontalAlignment="Center"
|
||||
IsEnabled="False"
|
||||
Margin="0,0,-50,20"
|
||||
VerticalAlignment="Bottom"
|
||||
Width="45"
|
||||
Width="35"
|
||||
x:Name="DeleteButton" />
|
||||
<Button
|
||||
Background="#4CAF50"
|
||||
@ -60,11 +75,11 @@
|
||||
CornerRadius="22"
|
||||
FontSize="24"
|
||||
Foreground="White"
|
||||
Height="45"
|
||||
Height="35"
|
||||
HorizontalAlignment="Right"
|
||||
Margin="0,0,20,20"
|
||||
VerticalAlignment="Bottom"
|
||||
Width="45"
|
||||
Width="35"
|
||||
x:Name="NewEntryButton" />
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
@ -28,6 +28,10 @@ public partial class MenuView : Window
|
||||
_controller = controller;
|
||||
}
|
||||
|
||||
private async void RefreshButton_OnClick(object? sender, Avalonia.Interactivity.RoutedEventArgs e)
|
||||
{
|
||||
CreateEntryButtons();
|
||||
}
|
||||
|
||||
//opens the window to create a new entry
|
||||
private async void NewEntryButton_OnClick(object? sender, Avalonia.Interactivity.RoutedEventArgs e)
|
||||
@ -67,7 +71,6 @@ public partial class MenuView : Window
|
||||
//shows the details for the selected entry
|
||||
public void EntryDetails(SavedEntries entry)
|
||||
{
|
||||
// ... vorheriger Code bleibt gleich bis zur PasswordBox ...
|
||||
|
||||
ShowEntryDetailsL.Children.Clear();
|
||||
ShowEntryDetailsR.Children.Clear();
|
||||
@ -171,17 +174,15 @@ public partial class MenuView : Window
|
||||
{
|
||||
await clipboard.SetTextAsync(Crypto.DecryptPassword(entry.Pass));
|
||||
|
||||
// Visuelle Bestätigung
|
||||
// visual feedback
|
||||
copyPasswordButton.Content = "✓";
|
||||
await Task.Delay(1000);
|
||||
copyPasswordButton.Content = "📋";
|
||||
}
|
||||
};
|
||||
|
||||
buttonContainer.Children.Add(showPasswordButton);
|
||||
buttonContainer.Children.Add(copyPasswordButton);
|
||||
ShowEntryDetailsR.Children.Add(buttonContainer);
|
||||
|
||||
|
||||
//show note if it exists
|
||||
if (!string.IsNullOrEmpty(entry.Note))
|
||||
{
|
||||
ShowEntryDetailsR.Children.Add(new TextBox()
|
||||
@ -190,6 +191,10 @@ public partial class MenuView : Window
|
||||
Margin = new Thickness(0, 0, 0, 5)
|
||||
});
|
||||
}
|
||||
//add buttons
|
||||
buttonContainer.Children.Add(showPasswordButton);
|
||||
buttonContainer.Children.Add(copyPasswordButton);
|
||||
ShowEntryDetailsR.Children.Add(buttonContainer);
|
||||
|
||||
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user