fix resources for showing the cluster relationship.
MODIFY
WalletWasabi.Fluent/Converters/BoolToBrushConverter.cs
WalletWasabi.Fluent/Converters/BoolToBrushConverter.cs
using System.Globalization;
+using Avalonia;
using Avalonia.Data.Converters;
using Avalonia.Media;
namespace WalletWasabi.Fluent.Converters;
-public class BoolToBrushConverter : IValueConverter
+public class BoolToBrushConverter : AvaloniaObject, IValueConverter
{
public static BoolToBrushConverter Instance { get; } = new();
- public IBrush? TrueBrush { get; set; }
- public IBrush? FalseBrush { get; set; }
+ public static readonly StyledProperty<IBrush?> TrueBrushProperty =
+ AvaloniaProperty.Register<BoolToBrushConverter, IBrush?>(nameof(TrueBrush));
+
+ public static readonly StyledProperty<IBrush?> FalseBrushProperty =
+ AvaloniaProperty.Register<BoolToBrushConverter, IBrush?>(nameof(FalseBrush));
+
+ public IBrush? TrueBrush
+ {
+ get => GetValue(TrueBrushProperty);
+ set => SetValue(TrueBrushProperty, value);
+ }
+
+ public IBrush? FalseBrush
+ {
+ get => GetValue(FalseBrushProperty);
+ set => SetValue(FalseBrushProperty, value);
+ }
public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
{
if (value is true)
{
- return TrueBrush;
+ return TrueBrush ?? AvaloniaProperty.UnsetValue;
}
else
{
- return FalseBrush;
+ return FalseBrush ?? AvaloniaProperty.UnsetValue;
}
}

MODIFY
WalletWasabi.Fluent/Styles/Themes/Base.axaml
WalletWasabi.Fluent/Styles/Themes/Base.axaml
<SolidColorBrush x:Key="PrivacyLevelExtremeBrush" Color="#89C67A" />
<SolidColorBrush x:Key="PrivacyLevelExtremeAltBrush" Color="#5B92D2" />
+ <SolidColorBrush x:Key="PrivacyControlItemWhiteListHighlight" Color="#72BD81" />
+ <SolidColorBrush x:Key="PrivacyControlItemBlackListHighlight" Color="#e01e5a" />
+
<SolidColorBrush x:Key="WarningMessageForeground">#DDA73E</SolidColorBrush>
<StaticResource x:Key="SystemControlErrorTextForegroundBrush" ResourceKey="SystemErrorTextColor" />
<SolidColorBrush x:Key="HyperLinkForeground">#00A2E8</SolidColorBrush>

MODIFY
WalletWasabi.Fluent/Styles/Themes/BaseLight.axaml
WalletWasabi.Fluent/Styles/Themes/BaseLight.axaml
<SolidColorBrush x:Key="PrivacyControlWhiteListHeaderForeground" Color="#394a1b" />
<SolidColorBrush x:Key="PrivacyControlWhiteListBackground" Color="#f5f8ee" />
<SolidColorBrush x:Key="PrivacyControlBlackListBackground" Color="Transparent" />
- <SolidColorBrush x:Key="PrivacyControlItemBackground" Color="#FFFFFFFF" />
+ <SolidColorBrush x:Key="PrivacyControlItemBackground" Color="#FFFFFF" />
<Color x:Key="SliderTrackValueFill">#0B2545</Color>
<Color x:Key="SliderTrackValueFillPointerOver">#0B2545</Color>

MODIFY
WalletWasabi.Fluent/Views/Wallets/Send/PrivacyControlView.axaml
WalletWasabi.Fluent/Views/Wallets/Send/PrivacyControlView.axaml
<i:Interaction.Behaviors>
<behaviors:BindPointerOverBehavior IsPointerOver="{Binding IsPointerOver}" />
</i:Interaction.Behaviors>
- <c:TagControl Content="{Binding Value}" IsHitTestVisible="False">
+ <c:TagControl Content="{Binding Value}" IsHitTestVisible="False" Background="{DynamicResource PrivacyControlItemHighlight}">
+ <c:TagControl.Foreground>
+ <Binding Path="IsHighlighted">
+ <Binding.Converter>
+ <converters:BoolToBrushConverter TrueBrush="{DynamicResource PrivacyControlItemWhiteListHighlight}" />
+ </Binding.Converter>
+ </Binding>
+ </c:TagControl.Foreground>
<c:TagControl.BorderBrush>
<Binding Path="IsHighlighted">
<Binding.Converter>
- <converters:BoolToBrushConverter TrueBrush="#F28A81" FalseBrush="{StaticResource PrivacyControlItemBackground}" />
+ <converters:BoolToBrushConverter TrueBrush="{DynamicResource PrivacyControlItemWhiteListHighlight}" />
</Binding.Converter>
</Binding>
</c:TagControl.BorderBrush>
<i:Interaction.Behaviors>
<behaviors:BindPointerOverBehavior IsPointerOver="{Binding IsPointerOver}" />
</i:Interaction.Behaviors>
- <c:TagControl Content="{Binding Value}" IsHitTestVisible="False">
+ <c:TagControl Content="{Binding Value}" IsHitTestVisible="False" Background="{DynamicResource Pric}">
+ <c:TagControl.Foreground>
+ <Binding Path="IsHighlighted">
+ <Binding.Converter>
+ <converters:BoolToBrushConverter TrueBrush="{DynamicResource PrivacyControlItemBlackListHighlight}" />
+ </Binding.Converter>
+ </Binding>
+ </c:TagControl.Foreground>
<c:TagControl.BorderBrush>
<Binding Path="IsHighlighted">
<Binding.Converter>
- <converters:BoolToBrushConverter TrueBrush="#22B161" FalseBrush="{StaticResource PrivacyControlItemBackground}" />
+ <converters:BoolToBrushConverter TrueBrush="{DynamicResource PrivacyControlItemBlackListHighlight}" />
</Binding.Converter>
</Binding>
</c:TagControl.BorderBrush>

fix resources for showing the cluster relationship.