Password finder charset selection
ADD
WalletWasabi.Fluent/Behaviors/ButtonInsideListBoxItem.cs
+using System.Reactive.Disposables;
+using System.Reactive.Linq;
+using Avalonia.Controls;
+using Avalonia.VisualTree;
+
+namespace WalletWasabi.Fluent.Behaviors;
+
+public class ButtonInsideListBoxItemBehavior : DisposingBehavior<Button>
+{
+ protected override void OnAttached(CompositeDisposable disposables)
+ {
+ if (AssociatedObject is null)
+ {
+ return;
+ }
+
+ Observable.FromEventPattern(AssociatedObject, nameof(Button.Click))
+ .Subscribe(x =>
+ {
+ if (x.Sender is Button button && button.FindAncestorOfType<ListBoxItem>() is { } listBoxItem)
+ {
+ listBoxItem.IsSelected = true;
+ }
+ })
+ .DisposeWith(disposables);
+ }
+}

MODIFY
WalletWasabi.Fluent/Controls/TileButton.axaml
WalletWasabi.Fluent/Controls/TileButton.axaml
<DockPanel>
<TextBlock x:Name="PART_Text"
Text="{TemplateBinding Text}"
- Foreground="{TemplateBinding Foreground}"
- DockPanel.Dock="Top" />
+ Foreground="{TemplateBinding Foreground}" />
+ <Panel>
<PathIcon x:Name="PART_Icon"
Data="{TemplateBinding Icon}"
Width="{TemplateBinding IconSize}"
Height="{TemplateBinding IconSize}" />
+
+ <ContentPresenter x:Name="PART_ContentPresenter"
+ Content="{TemplateBinding Content}"
+ Height="{TemplateBinding IconSize}"
+ Width="{TemplateBinding IconSize}" />
+ </Panel>
</DockPanel>
</Border>
</ControlTemplate>
<Setter Property="Foreground" Value="{StaticResource SystemAccentColor}" />
</Style>
+ <Style Selector="c|TileButton /template/ ContentPresenter#PART_ContentPresenter">
+ <Setter Property="HorizontalAlignment" Value="Center" />
+ <Setter Property="VerticalAlignment" Value="Center" />
+ <Setter Property="Margin" Value="0 0 0 15" />
+ </Style>
+
<Style Selector="c|TileButton /template/ TextBlock#PART_Text">
+ <Setter Property="DockPanel.Dock" Value="Top" />
<Setter Property="Margin" Value="10 10 10 15" />
<Setter Property="TextWrapping" Value="Wrap" />
- <Setter Property="MinHeight" Value="34" />
<Setter Property="HorizontalAlignment" Value="Center" />
<Setter Property="TextAlignment" Value="Center" />
</Style>
<Setter Property="BorderThickness" Value="1" />
<Setter Property="BorderBrush" Value="{DynamicResource SystemAccentColor}" />
</Style>
+
+ <!-- Double line Text -->
+ <Style Selector="c|TileButton.doubleline /template/ TextBlock#PART_Text">
+ <Setter Property="MinHeight" Value="34" />
+ </Style>
+
+ <!-- Bottom Text -->
+ <Style Selector="c|TileButton.bottomtext /template/ TextBlock#PART_Text">
+ <Setter Property="DockPanel.Dock" Value="Bottom" />
+ <Setter Property="Margin" Value="10 15 10 10" />
+ </Style>
+
+ <Style Selector="c|TileButton.bottomtext /template/ ContentPresenter#PART_ContentPresenter">
+ <Setter Property="Margin" Value="0 15 0 0" />
+ </Style>
</Styles>

MODIFY
WalletWasabi.Fluent/Views/AddWallet/AddWalletPageView.axaml
WalletWasabi.Fluent/Views/AddWallet/AddWalletPageView.axaml
EnableNext="False">
<UniformGrid Rows="1" HorizontalAlignment="Center">
<c:TileButton Text="Create a new wallet"
- Classes="action"
+ Classes="action doubleline"
Icon="{StaticResource add_regular}"
Command="{Binding CreateWalletCommand}"
IsDefault="{Binding IsActive}"
Margin="10" IconSize="60" />
<c:TileButton Text="Connect to hardware wallet"
+ Classes="doubleline"
Icon="{StaticResource calculator_regular}"
Command="{Binding ConnectHardwareWalletCommand}"
Margin="10" IconSize="60" />
<c:TileButton Text="Import a wallet"
+ Classes="doubleline"
Icon="{StaticResource import_regular}"
Command="{Binding ImportWalletCommand}"
Margin="10" IconSize="60" />
<c:TileButton Text="Recover a wallet"
+ Classes="doubleline"
Icon="{StaticResource recover_arrow_right_regular}"
Command="{Binding RecoverWalletCommand}"
Margin="10" IconSize="60" />

MODIFY
WalletWasabi.Fluent/Views/Login/PasswordFinder/SelectCharsetView.axaml
WalletWasabi.Fluent/Views/Login/PasswordFinder/SelectCharsetView.axaml
<UserControl xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ xmlns:i="using:Avalonia.Xaml.Interactivity"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:vm="using:WalletWasabi.Fluent.ViewModels.Login.PasswordFinder"
xmlns:c="using:WalletWasabi.Fluent.Controls"
xmlns:conv="using:WalletWasabi.Fluent.Converters"
+ xmlns:behaviors="using:WalletWasabi.Fluent.Behaviors"
mc:Ignorable="d" d:DesignWidth="428" d:DesignHeight="371"
x:DataType="vm:SelectCharsetViewModel"
x:CompileBindings="True"
<ListBox Items="{Binding Charsets}"
SelectedItem="{Binding SelectedCharset}"
- Background="Transparent">
+ Background="Transparent" VerticalAlignment="Center" HorizontalAlignment="Center">
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
- <WrapPanel HorizontalAlignment="Stretch" />
+ <UniformGrid Columns="3" />
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
+ <ListBox.Styles>
+ <Style Selector="ListBoxItem">
+ <Setter Property="Template">
+ <ControlTemplate>
+ <ContentPresenter Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" />
+ </ControlTemplate>
+ </Setter>
+ </Style>
+ </ListBox.Styles>
<ListBox.ItemTemplate>
<DataTemplate>
- <Border BoxShadow="{DynamicResource OptionButtonShadow}"
- Background="{DynamicResource OptionButtonBackground}"
- ToolTip.Tip="{Binding Converter={x:Static conv:EnumConverters.ToCharset}}"
- Margin="15"
- Width="180"
- Height="180">
- <Panel>
- <TextBlock FontSize="50" VerticalAlignment="Center" HorizontalAlignment="Center" Text="{Binding Converter={x:Static conv:EnumConverters.ToUpperCase}}"/>
- <TextBlock Opacity="0.6" Margin="0 0 0 10" FontWeight="Light" HorizontalAlignment="Center" VerticalAlignment="Bottom" Text="{Binding Converter={x:Static conv:EnumConverters.ToFriendlyName}}"/>
- </Panel>
- </Border>
+ <c:TileButton Text="{Binding Converter={x:Static conv:EnumConverters.ToFriendlyName}}"
+ IconSize="60" Margin="10 10 10 20" Classes="bottomtext"
+ ToolTip.Tip="{Binding Converter={x:Static conv:EnumConverters.ToCharset}}">
+ <i:Interaction.Behaviors>
+ <behaviors:ButtonInsideListBoxItemBehavior />
+ </i:Interaction.Behaviors>
+
+ <Viewbox>
+ <TextBlock FontSize="50" VerticalAlignment="Center" HorizontalAlignment="Center" Text="{Binding Converter={x:Static conv:EnumConverters.ToUpperCase}}"
+ Foreground="{DynamicResource SystemAccentColor}" />
+ </Viewbox>
+ </c:TileButton>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
-
</c:ContentArea>
</UserControl>

Password finder charset selection