Cryptura/Cryptura/MainWindow.axaml
WeeXnes 2156aff43c
All checks were successful
Java CI / test (push) Successful in 1m23s
Fixed some styling
2025-05-06 20:49:41 +02:00

120 lines
9.1 KiB
XML

<Window xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:Cryptura"
mc:Ignorable="d"
x:Class="Cryptura.MainWindow"
TransparencyLevelHint="AcrylicBlur"
Background="Transparent"
Height="400"
Width="520"
MinHeight="340"
MinWidth="340"
WindowStartupLocation="CenterScreen"
Title="Cryptura">
<!--ExtendClientAreaToDecorationsHint="True"-->
<Panel>
<ExperimentalAcrylicBorder IsHitTestVisible="False" Name="AcrylicBorderObject">
<ExperimentalAcrylicBorder.Material>
<ExperimentalAcrylicMaterial
BackgroundSource="Digger"
TintColor="Black"
TintOpacity="1"
MaterialOpacity="0.65"/>
</ExperimentalAcrylicBorder.Material>
</ExperimentalAcrylicBorder>
<Grid>
<Border Width="1" Background="#80000000" Margin="5,20" HorizontalAlignment="Center" ZIndex="1" Name="MiddleSeperator" IsVisible="False"/>
<Border Background="#80000000" CornerRadius="10" Margin="10" Name="ContentBorder">
<ListBox Name="PasswordList" Background="Transparent" SelectionChanged="PasswordList_OnSelectionChanged"
Margin="10">
<ListBox.ItemTemplate>
<DataTemplate x:DataType="local:Password">
<Border Background="Transparent" Padding="10">
<Border.ContextMenu>
<ContextMenu>
<MenuItem Header="Add New Password" Click="CreatePassword_OnClick"/>
<MenuItem Header="Remove Password" Click="DeletePassword_OnClick"/>
<MenuItem Header="Hide/Unhide Passwords" Click="ToggleHide_OnClick"/>
</ContextMenu>
</Border.ContextMenu>
<Grid ColumnDefinitions="*, *">
<TextBlock
Grid.Column="0"
Foreground="White"
Text="{Binding Name}"
VerticalAlignment="Center"
TextTrimming="CharacterEllipsis"
TextWrapping="NoWrap"
Margin="20,0"/>
<TextBlock
Grid.Column="1"
Foreground="White"
Text="{Binding DisplayValue}"
VerticalAlignment="Center"
TextTrimming="CharacterEllipsis"
TextWrapping="NoWrap"
Margin="20,0"/>
</Grid>
</Border>
</DataTemplate>
</ListBox.ItemTemplate>
<ListBox.ContextMenu>
<ContextMenu>
<MenuItem Header="Add New Password" Click="CreatePassword_OnClick"/>
<MenuItem Header="Hide/Unhide Passwords" Click="ToggleHide_OnClick"/>
</ContextMenu>
</ListBox.ContextMenu>
<ListBox.Styles>
<Style Selector="ListBoxItem:selected /template/ ContentPresenter">
<Setter Property="Background" Value="#40000000"/>
</Style>
<Style Selector="ListBoxItem:pointerover /template/ ContentPresenter">
<Setter Property="Background" Value="#20000000"></Setter>
</Style>
<Style Selector="ListBoxItem">
<Setter Property="Padding" Value="0"/>
<Setter Property="CornerRadius" Value="10"/>
</Style>
</ListBox.Styles>
</ListBox>
</Border>
<Border Background="#80000000" Name="AddPasswordContainer" IsVisible="False" PointerPressed="OuterBorder_OnPointerPressed" ZIndex="11">
<Border Background="#80000000" CornerRadius="10" PointerPressed="InnerBorder_OnPointerPressed"
Name="AddPasswordBorder"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Height="300"
Width="300">
<StackPanel Spacing="10" HorizontalAlignment="Stretch" VerticalAlignment="Center" Margin="20">
<TextBlock Text="Name:" Margin="20,0"/>
<TextBox Name="PasswordName"
Margin="20,0"
HorizontalAlignment="Stretch"
VerticalAlignment="Center"
KeyDown="DialogKeyDown"/>
<TextBlock Text="Password:" Margin="20,0"/>
<TextBox Name="PasswordValue"
Margin="20,0"
HorizontalAlignment="Stretch"
VerticalAlignment="Center"
KeyDown="DialogKeyDown"
PasswordChar="*"/>
<TextBlock Text="Repeat Password:" Margin="20,0"/>
<TextBox Name="PasswordRepeat"
Margin="20,0"
HorizontalAlignment="Stretch"
VerticalAlignment="Center"
KeyDown="DialogKeyDown"
PasswordChar="*"/>
<TextBlock Name="ErrorTextBlock" IsVisible="False" HorizontalAlignment="Center" Foreground="Crimson"/>
<Button Name="PasswordSave" Click="PasswordSave_OnClick" HorizontalAlignment="Center" VerticalAlignment="Center"
Content="Confirm"/>
</StackPanel>
</Border>
</Border>
</Grid>
</Panel>
</Window>