Skip to content

Commit

Permalink
Make sat/b nicer
Browse files Browse the repository at this point in the history
  • Loading branch information
nopara73 committed Dec 20, 2018
1 parent a9c077c commit cc2b88e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
5 changes: 3 additions & 2 deletions WalletWasabi.Gui/Controls/WalletExplorer/SendTabView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
</DrawingPresenter>
</Grid>

<Slider Minimum="{Binding MinimumFeeTarget}" Maximum="{Binding MaximumFeeTarget}" Value="{Binding FeeTarget}" Width="190" />
<Slider Minimum="{Binding MinimumFeeTarget}" Maximum="{Binding MaximumFeeTarget}" Value="{Binding FeeTarget}" Width="270" />

<Grid Height="10" Width="10">
<DrawingPresenter VerticalAlignment="Center" HorizontalAlignment="Center">
Expand All @@ -91,7 +91,8 @@
</StackPanel>
<StackPanel Orientation="Horizontal" Spacing="4">
<TextBlock Text="Confirmation Expected In:" />
<TextBlock Foreground="YellowGreen" Text="{Binding ConfirmationExpectedText}" />
<TextBlock Foreground="YellowGreen" Text="{Binding ConfirmationExpectedText}" Width="80" />
<TextBlock Foreground="{DynamicResource ThemeBorderHighBrush}" Text="{Binding FeeText}" />
</StackPanel>
</StackPanel>
</StackPanel>
Expand Down
17 changes: 12 additions & 5 deletions WalletWasabi.Gui/Controls/WalletExplorer/SendTabViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ public class SendTabViewModel : WalletActionViewModel
private int _minimumFeeTarget;
private int _maximumFeeTarget;
private string _confirmationExpectedText;
private string _feeText;
private string _password;
private string _address;
private string _label;
Expand All @@ -57,7 +58,7 @@ public SendTabViewModel(WalletViewModel walletViewModel)
ResetMax();
SetFeeTargetLimits();
FeeTarget = MinimumFeeTarget;
SetConfirmationExpectedText();
SetFeeTexts();

Global.Synchronizer.PropertyChanged += Synchronizer_PropertyChanged;

Expand Down Expand Up @@ -225,13 +226,13 @@ public SendTabViewModel(WalletViewModel walletViewModel)

this.WhenAnyValue(x => x.FeeTarget).Subscribe(_ =>
{
SetConfirmationExpectedText();
SetFeeTexts();
});

_suggestions = new ObservableCollection<SuggestionViewModel>();
}

private void SetConfirmationExpectedText()
private void SetFeeTexts()
{
AllFeeEstimate allFeeEstimate = Global.Synchronizer?.AllFeeEstimate;

Expand Down Expand Up @@ -277,7 +278,7 @@ private void SetConfirmationExpectedText()

if (allFeeEstimate != null)
{
ConfirmationExpectedText += $" ({allFeeEstimate.GetFeeRate(feeTarget).Satoshi} sat/byte)";
FeeText = $"({allFeeEstimate.GetFeeRate(feeTarget).Satoshi} sat/byte)";
}
}

Expand All @@ -294,7 +295,7 @@ private void Synchronizer_PropertyChanged(object sender, PropertyChangedEventArg
{
FeeTarget = MaximumFeeTarget;
}
SetConfirmationExpectedText();
SetFeeTexts();
}
}

Expand Down Expand Up @@ -434,6 +435,12 @@ public string ConfirmationExpectedText
set => this.RaiseAndSetIfChanged(ref _confirmationExpectedText, value);
}

public string FeeText
{
get => _feeText;
set => this.RaiseAndSetIfChanged(ref _feeText, value);
}

public string Password
{
get => _password;
Expand Down

0 comments on commit cc2b88e

Please sign in to comment.