add transition
MODIFY
WalletWasabi.Fluent/Controls/PreviewItem.axaml
WalletWasabi.Fluent/Controls/PreviewItem.axaml
IsVisible="{TemplateBinding CopyButtonVisibility}" />
</Panel>
<ContentPresenter Name="PART_ContentPresenter" Content="{TemplateBinding Content}"
- ContentTemplate="{TemplateBinding ContentTemplate}" />
+ ContentTemplate="{TemplateBinding ContentTemplate}"
+ IsVisible="{Binding !#PART_ContentReplacementTextBlock.IsVisible}" />
+ <TextBlock Name="PART_ContentReplacementTextBlock" IsVisible="{TemplateBinding PrivacyModeEnabled}"/>
</DockPanel>
</DockPanel>
</DockPanel>
<Setter Property="TextWrapping" Value="Wrap" />
</Style>
+ <Style Selector="c|PreviewItem /template/ TextBlock#PART_ContentReplacementTextBlock">
+ <Setter Property="Text" Value="Sensitive Data" />
+ <Setter Property="Foreground" Value="IndianRed" />
+ </Style>
+
+ <!-- Transitions -->
+ <Style Selector="c|PreviewItem /template/ ContentPresenter#PART_ContentPresenter,
+ c|PreviewItem /template/ TextBlock#PART_ContentReplacementTextBlock">
+ <Setter Property="Transitions">
+ <Transitions>
+ <DoubleTransition Property="Opacity" Duration="0:0:0.3" />
+ </Transitions>
+ </Setter>
+ </Style>
+ <Style Selector="c|PreviewItem /template/ TextBlock#PART_ContentReplacementTextBlock[IsVisible=True],
+ c|PreviewItem /template/ ContentPresenter#PART_ContentPresenter[IsVisible=True]">
+ <Setter Property="Opacity" Value="1" />
+ </Style>
+ <Style Selector="c|PreviewItem /template/ TextBlock#PART_ContentReplacementTextBlock[IsVisible=False],
+ c|PreviewItem /template/ ContentPresenter#PART_ContentPresenter[IsVisible=False]">
+ <Setter Property="Opacity" Value="0" />
+ </Style>
+
</Styles>

MODIFY
WalletWasabi.Fluent/Controls/PreviewItem.axaml.cs
WalletWasabi.Fluent/Controls/PreviewItem.axaml.cs
@@ -29,6 +29,9 @@ namespace WalletWasabi.Fluent.Controls
public static readonly StyledProperty<bool> CopyButtonVisibilityProperty =
AvaloniaProperty.Register<PreviewItem, bool>(nameof(CopyButtonVisibility));
+ public static readonly StyledProperty<bool> PrivacyModeEnabledProperty =
+ AvaloniaProperty.Register<PreviewItem, bool>(nameof(PrivacyModeEnabled));
+
private Stopwatch? _copyButtonPressedStopwatch;
public PreviewItem()
@@ -42,7 +45,11 @@ namespace WalletWasabi.Fluent.Controls
}
});
- this.WhenAnyValue(x => x.CopyParameter, x => x.IsPointerOver, (copyParameter, isPointerOver) => !string.IsNullOrEmpty(copyParameter?.ToString()) && isPointerOver)
+ this.WhenAnyValue(
+ x => x.CopyParameter,
+ x => x.IsPointerOver,
+ x => x.PrivacyModeEnabled,
+ (copyParameter, isPointerOver, privacyModeEnabled) => !string.IsNullOrEmpty(copyParameter?.ToString()) && isPointerOver && !privacyModeEnabled)
.Subscribe(async value =>
{
if (_copyButtonPressedStopwatch is { } sw)
@@ -98,5 +105,11 @@ namespace WalletWasabi.Fluent.Controls
get => GetValue(CopyButtonVisibilityProperty);
set => SetValue(CopyButtonVisibilityProperty, value);
}
+
+ public bool PrivacyModeEnabled
+ {
+ get => GetValue(PrivacyModeEnabledProperty);
+ set => SetValue(PrivacyModeEnabledProperty, value);
+ }
}
}

MODIFY
WalletWasabi.Fluent/Views/Wallets/Advanced/WalletInfoView.axaml
WalletWasabi.Fluent/Views/Wallets/Advanced/WalletInfoView.axaml
Text="Extended Master Private Key"
Content="{Binding ExtendedMasterPrivateKey}"
CopyParameter="{Binding ExtendedMasterPrivateKey}"
- IsVisible="{Binding !!ExtendedMasterPrivateKey}" />
+ IsVisible="{Binding !!ExtendedMasterPrivateKey}"
+ PrivacyModeEnabled="{Binding !ShowSensitiveData}" />
<Separator IsVisible="{Binding !!ExtendedMasterPrivateKey}" />
+
<c:PreviewItem Icon="{StaticResource wasabi_logo}"
Text="Extended Master zprv"
Content="{Binding ExtendedMasterZprv}"
CopyParameter="{Binding ExtendedMasterZprv}"
- IsVisible="{Binding !!ExtendedMasterZprv}" />
+ IsVisible="{Binding !!ExtendedMasterZprv}"
+ PrivacyModeEnabled="{Binding !ShowSensitiveData}" />
<Separator IsVisible="{Binding !!ExtendedMasterZprv}" />
+
<c:PreviewItem Icon="{StaticResource wasabi_logo}"
Text="Extended Master Fingerprint"
Content="{Binding MasterKeyFingerprint}"
CopyParameter="{Binding MasterKeyFingerprint}" />
<Separator />
+
<c:PreviewItem Icon="{StaticResource wasabi_logo}"
Text="Account Key Path"
Content="{Binding AccountKeyPath}"
CopyParameter="{Binding AccountKeyPath}" />
<Separator />
+
<c:PreviewItem Icon="{StaticResource wasabi_logo}"
Text="Extended Account Private Key"
Content="{Binding ExtendedAccountPrivateKey}"
CopyParameter="{Binding ExtendedAccountPrivateKey}"
- IsVisible="{Binding !!ExtendedAccountPrivateKey}" />
+ IsVisible="{Binding !!ExtendedAccountPrivateKey}"
+ PrivacyModeEnabled="{Binding !ShowSensitiveData}" />
<Separator IsVisible="{Binding !!ExtendedAccountPrivateKey}" />
+
<c:PreviewItem Icon="{StaticResource wasabi_logo}"
Text="Extended Account zprv"
Content="{Binding ExtendedAccountZprv}"
CopyParameter="{Binding ExtendedAccountZprv}"
- IsVisible="{Binding !!ExtendedAccountZprv}" />
+ IsVisible="{Binding !!ExtendedAccountZprv}"
+ PrivacyModeEnabled="{Binding !ShowSensitiveData}" />
<Separator IsVisible="{Binding !!ExtendedAccountZprv}" />
+
<c:PreviewItem Icon="{StaticResource wasabi_logo}"
Text="Extended Account Public Key"
Content="{Binding ExtendedAccountPublicKey}"
CopyParameter="{Binding ExtendedAccountPublicKey}" />
<Separator />
+
<c:PreviewItem Icon="{StaticResource wasabi_logo}"
Text="Extended Account zpub"
Content="{Binding ExtendedAccountZpub}"

add transition