Files
Walleby/Wallet.Avalonia/PasswordEntryView.axaml
T
2024-07-06 12:11:39 +01:00

93 lines
6.5 KiB
XML

<SettingsExpander
x:Class="Wallet.Avalonia.PasswordEntryView"
xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:vm="using:Wallet"
x:DataType="vm:PasswordEntryViewModel"
Header="{Binding Key}"
IsExpanded="False">
<SettingsExpander.Resources>
<Thickness x:Key="TextControlThemePadding">10,5,6,6</Thickness>
<Thickness x:Key="TextControlCompactThemePadding">0</Thickness>
</SettingsExpander.Resources>
<SettingsExpander.Action>
<Button
Grid.Column="1"
Width="{StaticResource ButtonWidth}"
Height="{StaticResource ButtonHeight}"
Theme="{StaticResource TransparentButton}">
<Viewbox Width="14" Height="14">
<PathIcon
HorizontalAlignment="Center"
VerticalAlignment="Center"
Data="F1 M 3.28 13.4 C 3.493333 12.333333 3.926666 11.373333 4.58 10.52 C 5.233333 9.666667 6.033333 9 6.98 8.52 C 7.926666 8.039999 8.933332 7.799999 10 7.799999 C 11.066666 7.799999 12.073333 8.039999 13.02 8.52 C 13.966666 9 14.766666 9.666667 15.42 10.52 C 16.073334 11.373333 16.52 12.333333 16.76 13.4 C 16.786667 13.533333 16.853333 13.639999 16.959999 13.719999 C 17.066666 13.799999 17.186665 13.826666 17.32 13.799999 C 17.453333 13.773333 17.559999 13.699999 17.639999 13.579999 C 17.719999 13.459999 17.746666 13.333333 17.719999 13.2 C 17.453333 11.973333 16.946667 10.873333 16.199999 9.9 C 15.453332 8.926666 14.539999 8.166667 13.46 7.62 C 12.379999 7.073334 11.226666 6.8 10 6.799999 C 8.773333 6.8 7.62 7.073334 6.54 7.62 C 5.46 8.166667 4.546667 8.926666 3.8 9.9 C 3.053333 10.873333 2.546666 11.973333 2.28 13.2 C 2.253333 13.333333 2.28 13.459999 2.36 13.579999 C 2.44 13.699999 2.546667 13.773333 2.68 13.799999 C 2.813333 13.826666 2.933333 13.799999 3.04 13.719999 C 3.146666 13.639999 3.226666 13.533333 3.28 13.4 Z M 10 9.799999 C 9.039999 9.799999 8.213333 10.139999 7.52 10.82 C 6.826666 11.5 6.486667 12.326666 6.5 13.299999 C 6.513333 14.273333 6.86 15.099999 7.54 15.779999 C 8.219999 16.459999 9.039999 16.799999 10 16.799999 C 10.959999 16.799999 11.786666 16.459999 12.48 15.779999 C 13.173332 15.099999 13.519999 14.273333 13.52 13.299999 C 13.519999 12.326666 13.173332 11.5 12.48 10.82 C 11.786666 10.139999 10.959999 9.799999 10 9.799999 Z M 7.52 13.28 C 7.493333 12.613334 7.726666 12.033333 8.22 11.539999 C 8.713333 11.046666 9.306666 10.799999 10 10.799999 C 10.693333 10.799999 11.28 11.046666 11.759999 11.539999 C 12.239999 12.033333 12.486666 12.62 12.5 13.299999 C 12.513332 13.98 12.273333 14.566667 11.78 15.059999 C 11.286667 15.553333 10.693333 15.799999 10 15.799999 C 9.306666 15.799999 8.719999 15.553333 8.24 15.059999 C 7.759999 14.566667 7.52 13.973333 7.52 13.28 Z " />
</Viewbox>
</Button>
</SettingsExpander.Action>
<SettingsExpander.Footer>
<TextBox
Classes="revealPasswordButton"
PasswordChar="&#x25CF;"
Text="{Binding Value}">
<TextBox.Styles>
<Style Selector="TextBox.Write">
<Setter Property="MaxWidth" Value="{Binding Width}" />
<Setter Property="MinWidth" Value="{Binding Width}" />
<Setter Property="Padding" Value="{StaticResource TextControlThemePadding}" />
<Setter Property="TextWrapping" Value="NoWrap" />
</Style>
<Style Selector="TextBox.Read">
<Setter Property="MinWidth" Value="0" />
<Setter Property="IsReadOnly" Value="True" />
<Setter Property="BorderBrush" Value="Transparent" />
<Setter Property="Background" Value="Transparent" />
<Setter Property="Padding" Value="{StaticResource TextControlCompactThemePadding}" />
<Setter Property="MinHeight" Value="0" />
<Setter Property="TextWrapping" Value="Wrap" />
<Setter Property="Foreground">
<Setter.Value>
<SolidColorBrush Opacity="0.7" Color="{DynamicResource TextFillColorPrimary}" />
</Setter.Value>
</Setter>
<Style Selector="^:pointerover">
<Setter Property="Foreground">
<Setter.Value>
<SolidColorBrush Opacity="0.7" Color="{DynamicResource TextFillColorPrimary}" />
</Setter.Value>
</Setter>
<Style Selector="^ /template/ Border#PART_BorderElement">
<Setter Property="BorderBrush" Value="Transparent" />
<Setter Property="Background" Value="Transparent" />
</Style>
</Style>
<Style Selector="^:focus">
<Setter Property="Foreground">
<Setter.Value>
<SolidColorBrush Opacity="0.7" Color="{DynamicResource TextFillColorPrimary}" />
</Setter.Value>
</Setter>
<Style Selector="^ /template/ Border#PART_BorderElement">
<Setter Property="Background" Value="Transparent" />
<Setter Property="BorderBrush" Value="Transparent" />
</Style>
</Style>
</Style>
</TextBox.Styles>
<Interaction.Behaviors>
<DataTriggerBehavior Binding="{Binding State}" Value="{x:Static vm:ItemState.Read}">
<AddClassAction ClassName="Read" RemoveIfExists="True" />
<RemoveClassAction ClassName="Write" />
</DataTriggerBehavior>
<DataTriggerBehavior Binding="{Binding State}" Value="{x:Static vm:ItemState.New}">
<AddClassAction ClassName="Write" RemoveIfExists="True" />
<RemoveClassAction ClassName="Read" />
</DataTriggerBehavior>
<DataTriggerBehavior Binding="{Binding State}" Value="{x:Static vm:ItemState.Write}">
<AddClassAction ClassName="Write" RemoveIfExists="True" />
<RemoveClassAction ClassName="Read" />
</DataTriggerBehavior>
</Interaction.Behaviors>
</TextBox>
</SettingsExpander.Footer>
</SettingsExpander>