UI cleanup
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
x:Class="Wallet.Avalonia.TextEntryView"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:ui="using:FluentAvalonia.UI.Controls"
|
||||
xmlns:vm="using:Wallet"
|
||||
x:DataType="vm:TextEntryViewModel"
|
||||
Header="{Binding Key}"
|
||||
@@ -19,78 +20,144 @@
|
||||
</ResourceDictionary>
|
||||
</ResourceDictionary.ThemeDictionaries>
|
||||
</ResourceDictionary>
|
||||
<Thickness x:Key="ButtonMargin">0,0,12,0</Thickness>
|
||||
<Thickness x:Key="ButtonPadding">0</Thickness>
|
||||
<x:Double x:Key="ButtonMinWidth">32</x:Double>
|
||||
<x:Double x:Key="ButtonMinHeight">32</x:Double>
|
||||
<Thickness x:Key="TextControlMargin">0</Thickness>
|
||||
<Thickness x:Key="TextControlPadding">10,6,6,5</Thickness>
|
||||
<Thickness x:Key="TextControlCompactPadding">0</Thickness>
|
||||
<Thickness x:Key="TextControlCompactMargin">0</Thickness>
|
||||
</SettingsExpander.Resources>
|
||||
<SettingsExpander.Icon />
|
||||
<SettingsExpander.Action>
|
||||
<ItemEntryActionView />
|
||||
</SettingsExpander.Action>
|
||||
<SettingsExpander.Footer>
|
||||
<TextBox Classes="clearButton" Text="{Binding Value}">
|
||||
<TextBox.Styles>
|
||||
<Style Selector="TextBox.Write">
|
||||
<Setter Property="MaxWidth" Value="{Binding Width}" />
|
||||
<SettingsExpander.Styles>
|
||||
<Style Selector="SettingsExpander.Write">
|
||||
<Style Selector="^ /template/ SettingsExpanderItem#ContentHost">
|
||||
<Style Selector="^ /template/ ContentPresenter#FooterPresenter">
|
||||
<Setter Property="MinWidth" Value="{Binding Width}" />
|
||||
<Setter Property="Margin" Value="{StaticResource TextControlMargin}" />
|
||||
<Setter Property="Padding" Value="{StaticResource TextControlPadding}" />
|
||||
<Setter Property="TextWrapping" Value="NoWrap" />
|
||||
</Style>
|
||||
<Style Selector="TextBox.Read">
|
||||
<Style Selector="^:footerBottom /template/ ContentPresenter#FooterPresenter">
|
||||
<Setter Property="HorizontalAlignment" Value="Stretch" />
|
||||
<Setter Property="MinWidth" Value="0" />
|
||||
<Setter Property="IsReadOnly" Value="True" />
|
||||
<Setter Property="BorderBrush" Value="Transparent" />
|
||||
<Setter Property="BorderThickness" Value="0" />
|
||||
<Setter Property="Background" Value="Transparent" />
|
||||
<Setter Property="Margin" Value="{StaticResource TextControlCompactMargin}" />
|
||||
<Setter Property="Padding" Value="{StaticResource TextControlCompactPadding}" />
|
||||
<Setter Property="MinHeight" Value="0" />
|
||||
<Setter Property="TextWrapping" Value="NoWrap" />
|
||||
</Style>
|
||||
</Style>
|
||||
<Style Selector="^ TextBox">
|
||||
<Setter Property="MinWidth" Value="0" />
|
||||
<Setter Property="Margin" Value="{StaticResource TextControlMargin}" />
|
||||
<Setter Property="Padding" Value="{StaticResource TextControlPadding}" />
|
||||
<Setter Property="TextWrapping" Value="NoWrap" />
|
||||
</Style>
|
||||
</Style>
|
||||
<Style Selector="SettingsExpander.Read">
|
||||
<Style Selector="^ /template/ SettingsExpanderItem#ContentHost">
|
||||
<Style Selector="^ /template/ ContentPresenter#FooterPresenter">
|
||||
<Setter Property="MinWidth" Value="0" />
|
||||
</Style>
|
||||
<Style Selector="^:footerBottom /template/ ContentPresenter#FooterPresenter">
|
||||
<Setter Property="HorizontalAlignment" Value="Stretch" />
|
||||
<Setter Property="MinWidth" Value="0" />
|
||||
</Style>
|
||||
</Style>
|
||||
<Style Selector="^ TextBox">
|
||||
<Setter Property="MinWidth" Value="0" />
|
||||
<Setter Property="IsReadOnly" Value="True" />
|
||||
<Setter Property="BorderBrush" Value="Transparent" />
|
||||
<Setter Property="BorderThickness" Value="0" />
|
||||
<Setter Property="Background" Value="Transparent" />
|
||||
<Setter Property="Margin" Value="{StaticResource TextControlCompactMargin}" />
|
||||
<Setter Property="Padding" Value="{StaticResource TextControlCompactPadding}" />
|
||||
<Setter Property="MinHeight" Value="0" />
|
||||
<Setter Property="TextWrapping" Value="NoWrap" />
|
||||
<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="^: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 Selector="^ /template/ Border#PART_BorderElement">
|
||||
<Setter Property="BorderBrush" Value="Transparent" />
|
||||
<Setter Property="Background" Value="Transparent" />
|
||||
</Style>
|
||||
</Style>
|
||||
</TextBox.Styles>
|
||||
<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>
|
||||
</Style>
|
||||
</SettingsExpander.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>
|
||||
<SettingsExpander.Icon>
|
||||
<Button
|
||||
Grid.Column="1"
|
||||
MinWidth="{StaticResource ButtonMinWidth}"
|
||||
MinHeight="{StaticResource ButtonMinHeight}"
|
||||
Margin="{StaticResource ButtonMargin}"
|
||||
Padding="{StaticResource ButtonPadding}"
|
||||
HorizontalContentAlignment="Center"
|
||||
VerticalContentAlignment="Center"
|
||||
Command="{Binding RemoveCommand}"
|
||||
Theme="{StaticResource TransparentButton}">
|
||||
<Viewbox Height="20">
|
||||
<TextBlock
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
FontFamily="{StaticResource FluentThemeFontFamily}"
|
||||
FontSize="16"
|
||||
Text="" />
|
||||
</Viewbox>
|
||||
<Button.Styles>
|
||||
<Style Selector="Button.Hide">
|
||||
<Setter Property="IsVisible" Value="True" />
|
||||
</Style>
|
||||
<Style Selector="Button.Show">
|
||||
<Setter Property="IsVisible" Value="False" />
|
||||
</Style>
|
||||
</Button.Styles>
|
||||
<Interaction.Behaviors>
|
||||
<DataTriggerBehavior Binding="{Binding State}" Value="{x:Static vm:ItemState.Read}">
|
||||
<AddClassAction ClassName="Read" RemoveIfExists="True" />
|
||||
<RemoveClassAction ClassName="Write" />
|
||||
<AddClassAction ClassName="Show" RemoveIfExists="True" />
|
||||
<RemoveClassAction ClassName="Hide" />
|
||||
</DataTriggerBehavior>
|
||||
<DataTriggerBehavior Binding="{Binding State}" Value="{x:Static vm:ItemState.New}">
|
||||
<AddClassAction ClassName="Write" RemoveIfExists="True" />
|
||||
<RemoveClassAction ClassName="Read" />
|
||||
<AddClassAction ClassName="Hide" RemoveIfExists="True" />
|
||||
<RemoveClassAction ClassName="Show" />
|
||||
</DataTriggerBehavior>
|
||||
<DataTriggerBehavior Binding="{Binding State}" Value="{x:Static vm:ItemState.Write}">
|
||||
<AddClassAction ClassName="Write" RemoveIfExists="True" />
|
||||
<RemoveClassAction ClassName="Read" />
|
||||
<AddClassAction ClassName="Hide" RemoveIfExists="True" />
|
||||
<RemoveClassAction ClassName="Show" />
|
||||
</DataTriggerBehavior>
|
||||
</Interaction.Behaviors>
|
||||
</TextBox>
|
||||
</Button>
|
||||
</SettingsExpander.Icon>
|
||||
<SettingsExpander.Action>
|
||||
<ItemEntryActionView />
|
||||
</SettingsExpander.Action>
|
||||
<SettingsExpander.Footer>
|
||||
<TextBox Classes="clearButton" Text="{Binding Value}" />
|
||||
</SettingsExpander.Footer>
|
||||
</SettingsExpander>
|
||||
|
||||
Reference in New Issue
Block a user