Focus on PIN input when locked;
Add zero, clear & backspace in keypad.
MODIFY
WalletWasabi.Gui/Controls/LockScreen/PinLockScreen.xaml
WalletWasabi.Gui/Controls/LockScreen/PinLockScreen.xaml
<Grid Classes="Shade" Background="{DynamicResource ThemeBackgroundBrush}">
<controls:GroupBox VerticalAlignment="Center" HorizontalAlignment="Center" TextBlock.FontSize="25" Padding="20" Margin="10">
<DockPanel LastChildFill ="True">
- <controls:NoparaPasswordBox Password="{Binding PinInput}" Width="300" DockPanel.Dock="Top" Margin="4 0 4 20" Watermark="PIN" UseFloatingWatermark="True" />
+ <controls:NoparaPasswordBox x:Name="InputField" Password="{Binding PinInput}" Width="300" DockPanel.Dock="Top" Margin="4 0 4 20" Watermark="PIN" UseFloatingWatermark="True" />
<Grid DockPanel.Dock="Bottom">
- <TextBlock Text="Wrong PIN!" VerticalAlignment="Center" FontSize="20" Classes="warningMessage" IsVisible="{Binding WarningMessageVisible}" />
+ <TextBlock Text="Wrong PIN!"
+ Margin="0,12,0,0" VerticalAlignment="Center" FontSize="20" Classes="warningMessage" IsVisible="{Binding WarningMessageVisible}" />
</Grid>
- <Grid RowDefinitions="*,*,*" ColumnDefinitions="*,*,*">
+ <Grid RowDefinitions="*,*,*,*" ColumnDefinitions="*,*,*">
<Grid.Styles>
<Style Selector="Button">
<Setter Property="Margin" Value="4" />
<Button Grid.Row="2" Grid.Column="0" Content="1" Command="{Binding KeyPadCommand}" CommandParameter="1" />
<Button Grid.Row="2" Grid.Column="1" Content="2" Command="{Binding KeyPadCommand}" CommandParameter="2" />
<Button Grid.Row="2" Grid.Column="2" Content="3" Command="{Binding KeyPadCommand}" CommandParameter="3" />
+ <Button Grid.Row="3" Grid.Column="0" Content="CLEAR" Command="{Binding KeyPadCommand}" CommandParameter="CLEAR" />
+ <Button Grid.Row="3" Grid.Column="1" Content="0" Command="{Binding KeyPadCommand}" CommandParameter="0" />
+ <Button Grid.Row="3" Grid.Column="2" Content="BACK" Command="{Binding KeyPadCommand}" CommandParameter="BACK" />
</Grid>
</DockPanel>
</controls:GroupBox>

MODIFY
WalletWasabi.Gui/Controls/LockScreen/PinLockScreen.xaml.cs
WalletWasabi.Gui/Controls/LockScreen/PinLockScreen.xaml.cs
using Avalonia.Controls;
using Avalonia.Markup.Xaml;
using Avalonia;
+using Avalonia.Input;
+using ReactiveUI;
+using System.Reactive.Linq;
+using System;
namespace WalletWasabi.Gui.Controls.LockScreen
{
@@ -22,6 +26,12 @@ namespace WalletWasabi.Gui.Controls.LockScreen
public PinLockScreen() : base()
{
InitializeComponent();
+
+ var inputField = this.FindControl<NoparaPasswordBox>("InputField");
+
+ this.WhenAnyValue(x => x.IsLocked)
+ .Where(x => x)
+ .Subscribe(x => inputField.Focus());
}
private void InitializeComponent()

MODIFY
WalletWasabi.Gui/Controls/LockScreen/PinLockScreenViewModel.cs
WalletWasabi.Gui/Controls/LockScreen/PinLockScreenViewModel.cs
@@ -42,8 +42,21 @@ namespace WalletWasabi.Gui.Controls.LockScreen
Disposables = new CompositeDisposable();
KeyPadCommand = ReactiveCommand.Create<string>((arg) =>
+ {
+ if (arg == "BACK" && PinInput.Length > 0)
+ {
+ PinInput = PinInput.Substring(0, PinInput.Length - 1);
+ WarningMessageVisible = false;
+ }
+ else if (arg == "CLEAR")
+ {
+ PinInput = string.Empty;
+ WarningMessageVisible = false;
+ }
+ else
{
PinInput += arg;
+ }
});
this.WhenAnyValue(x => x.PinInput)
@@ -59,6 +72,7 @@ namespace WalletWasabi.Gui.Controls.LockScreen
.ObserveOn(RxApp.MainThreadScheduler)
.ToProperty(this, x => x.IsLocked)
.DisposeWith(Disposables);
+
}
private void CheckPIN(string input)

MODIFY
WalletWasabi.Gui/Controls/LockScreen/SlideLockScreenViewModel.cs
WalletWasabi.Gui/Controls/LockScreen/SlideLockScreenViewModel.cs
@@ -28,6 +28,7 @@ namespace WalletWasabi.Gui.Controls.LockScreen
get => _threshold;
set => this.RaiseAndSetIfChanged(ref _threshold, value);
}
+
private double _offset;
public double Offset
{

Focus on PIN input when locked;
Add zero, clear & backspace in keypad.