search progress view
MODIFY
WalletWasabi.Fluent/ViewModels/Login/PasswordFinder/SearchPasswordViewModel.cs
WalletWasabi.Fluent/ViewModels/Login/PasswordFinder/SearchPasswordViewModel.cs
@@ -8,12 +8,17 @@ namespace WalletWasabi.Fluent.ViewModels.Login.PasswordFinder
public partial class SearchPasswordViewModel : RoutableViewModel
{
[AutoNotify] private int _percentage;
- [AutoNotify] private string _remainingText;
+ [AutoNotify] private int _remainingHour;
+ [AutoNotify] private int _remainingMin;
+ [AutoNotify] private int _remainingSec;
+ [AutoNotify] private string _hourText;
+ [AutoNotify] private string _minText;
+ [AutoNotify] private string _secText;
+
public SearchPasswordViewModel(PasswordFinderOptions options)
{
Title = "Password Finder";
- _remainingText = "";
Task.Run(() =>
{
@@ -26,14 +31,13 @@ namespace WalletWasabi.Fluent.ViewModels.Login.PasswordFinder
{
Percentage = percentage;
- var h = remainingTime.Hours;
- var m = remainingTime.Minutes;
- var s = remainingTime.Seconds;
+ RemainingHour = remainingTime.Hours;
+ RemainingMin = remainingTime.Minutes;
+ RemainingSec = remainingTime.Seconds;
- RemainingText = "The search will finish in " +
- $"{h} hour{AddSIfPlural(h)}, " +
- $"{m} minute{AddSIfPlural(m)}, " +
- $"{s} second{AddSIfPlural(s)}.";
+ HourText = $" hour{AddSIfPlural(RemainingHour)} ";
+ MinText = $" minute{AddSIfPlural(RemainingMin)} ";
+ SecText = $" second{AddSIfPlural(RemainingSec)}.";
}
private static string AddSIfPlural(int n) => n > 1 ? "s" : "";

MODIFY
WalletWasabi.Fluent/Views/Login/PasswordFinder/SearchPasswordView.axaml
WalletWasabi.Fluent/Views/Login/PasswordFinder/SearchPasswordView.axaml
Caption="We can find your password anytime during the search"
EnableNext="False"
EnableCancel="True"
- EnableBack="False">
- <StackPanel VerticalAlignment="Center" HorizontalAlignment="Stretch">
+ EnableBack="False"
+ ScrollViewer.VerticalScrollBarVisibility="Disabled">
+
+ <DockPanel VerticalAlignment="Center" HorizontalAlignment="Stretch">
+ <Viewbox MaxHeight="200" DockPanel.Dock="Top">
<Panel HorizontalAlignment="Center">
- <c:ProgressRing IsIndeterminate="True" Height="100" Width="100" />
- <TextBlock Text="{Binding Percentage}" VerticalAlignment="Center" HorizontalAlignment="Center"/>
+ <c:ProgressRing Height="150" Width="150" IsIndeterminate="True"/>
+ <TextBlock Text="{Binding Percentage, StringFormat={}{0}%}" FontSize="20" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Panel>
- <TextBlock Text="{Binding RemainingText}" Margin="0 20 0 0" HorizontalAlignment="Center"/>
+ </Viewbox>
+
+ <StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Margin="0 30" DockPanel.Dock="Bottom">
+ <StackPanel.Styles>
+ <Style Selector="TextBlock">
+ <Setter Property="VerticalAlignment" Value="Bottom"/>
+ <Setter Property="FontWeight" Value="UltraLight"/>
+ </Style>
+ <Style Selector="TextBlock.countValue">
+ <Setter Property="FontSize" Value="20"/>
+ <Setter Property="FontWeight" Value="Bold"/>
+ <Setter Property="Margin" Value="0 0 0 -2"/>
+ <Setter Property="Foreground" Value="{DynamicResource SystemAccentColor}"/>
+ </Style>
+ </StackPanel.Styles>
+ <TextBlock Text="The search will finish in " />
+ <TextBlock Text="{Binding RemainingHour}" Classes="countValue" IsVisible="{Binding !!RemainingHour}"/>
+ <TextBlock Text="{Binding HourText}" IsVisible="{Binding !!RemainingHour}"/>
+ <TextBlock Text="{Binding RemainingMin}" Classes="countValue" IsVisible="{Binding !!RemainingMin}"/>
+ <TextBlock Text="{Binding MinText}" IsVisible="{Binding !!RemainingMin}"/>
+ <TextBlock Text="{Binding RemainingSec}" Classes="countValue"/>
+ <TextBlock Text="{Binding SecText}"/>
</StackPanel>
+ </DockPanel>
</c:ContentArea>
</UserControl>

search progress view