fix laggy size
MODIFY
WalletWasabi.Fluent/Controls/PrivacyContentControl.axaml
WalletWasabi.Fluent/Controls/PrivacyContentControl.axaml
<ControlTemplate>
<Panel Background="Transparent">
<ContentPresenter Name="PART_Content"
- Opacity="{Binding !#PART_PrivacyReplacement.IsVisible, Converter={x:Static conv:BoolOpacityConverters.BoolToOpacity}}"
+ Opacity="{TemplateBinding IsContentVisible, Converter={x:Static conv:BoolOpacityConverters.BoolToOpacity}}"
IsVisible="{Binding $self.Opacity, Converter={x:Static conv:BoolOpacityConverters.OpacityToBool}}"
ContentTemplate="{TemplateBinding ContentTemplate}"
Content="{TemplateBinding Content}"
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" />
<Panel Name="PART_PrivacyReplacement"
- Opacity="{TemplateBinding PrivacyModeEnabled, Converter={x:Static conv:BoolOpacityConverters.BoolToOpacity}}"
+ Opacity="{TemplateBinding IsPrivacyContentVisible, Converter={x:Static conv:BoolOpacityConverters.BoolToOpacity}}"
IsVisible="{Binding $self.Opacity, Converter={x:Static conv:BoolOpacityConverters.OpacityToBool}}">
<Viewbox Name="PART_Icon">
<PathIcon Data="{StaticResource incognito_regular}" Opacity="0.15" />
controls|PrivacyContentControl /template/ Panel#PART_PrivacyReplacement">
<Setter Property="Transitions">
<Transitions>
- <DoubleTransition Property="Opacity" Duration="0:0:0.15" Easing="{StaticResource FluentEasing}" />
+ <DoubleTransition Property="Opacity" Duration="0:0:0.2" Easing="{StaticResource FluentEasing}" />
</Transitions>
</Setter>
</Style>

MODIFY
WalletWasabi.Fluent/Controls/PrivacyContentControl.axaml.cs
WalletWasabi.Fluent/Controls/PrivacyContentControl.axaml.cs
@@ -20,8 +20,11 @@ namespace WalletWasabi.Fluent.Controls
private CompositeDisposable? _disposable;
- public static readonly StyledProperty<bool> PrivacyModeEnabledProperty =
- AvaloniaProperty.Register<PrivacyContentControl, bool>(nameof(PrivacyModeEnabled));
+ public static readonly StyledProperty<bool> IsPrivacyContentVisibleProperty =
+ AvaloniaProperty.Register<PrivacyContentControl, bool>(nameof(IsPrivacyContentVisible));
+
+ public static readonly StyledProperty<bool> IsContentVisibleProperty =
+ AvaloniaProperty.Register<PrivacyContentControl, bool>(nameof(IsContentVisible));
public static readonly StyledProperty<uint> NumberOfPrivacyCharsProperty =
AvaloniaProperty.Register<PrivacyContentControl, uint>(nameof(NumberOfPrivacyChars), 5);
@@ -32,10 +35,16 @@ namespace WalletWasabi.Fluent.Controls
public static readonly StyledProperty<ReplacementMode> PrivacyReplacementModeProperty =
AvaloniaProperty.Register<PrivacyContentControl, ReplacementMode>(nameof(PrivacyReplacementMode));
- private bool PrivacyModeEnabled
+ private bool IsPrivacyContentVisible
{
- get => GetValue(PrivacyModeEnabledProperty);
- set => SetValue(PrivacyModeEnabledProperty, value);
+ get => GetValue(IsPrivacyContentVisibleProperty);
+ set => SetValue(IsPrivacyContentVisibleProperty, value);
+ }
+
+ private bool IsContentVisible
+ {
+ get => GetValue(IsContentVisibleProperty);
+ set => SetValue(IsContentVisibleProperty, value);
}
public uint NumberOfPrivacyChars
@@ -65,7 +74,11 @@ namespace WalletWasabi.Fluent.Controls
Services.UiConfig
.WhenAnyValue(x => x.PrivacyMode)
.ObserveOn(RxApp.MainThreadScheduler)
- .Subscribe(value => PrivacyModeEnabled = value)
+ .Subscribe(value =>
+ {
+ IsPrivacyContentVisible = value;
+ IsContentVisible = !value;
+ })
.DisposeWith(_disposable);
PrivacyText = new string(Enumerable.Repeat(PrivacyChar, (int) NumberOfPrivacyChars).ToArray());

fix laggy size