make copy button visible only if the mouse is on the control
MODIFY
WalletWasabi.Fluent/Controls/PreviewItem.axaml
WalletWasabi.Fluent/Controls/PreviewItem.axaml
<Style Selector="c|PreviewItem">
<Setter Property="Template">
<ControlTemplate>
- <DockPanel>
+ <DockPanel Background="Transparent">
<PathIcon Width="{TemplateBinding IconSize}" Height="{TemplateBinding IconSize}"
Data="{TemplateBinding Icon}" Opacity="0.6" Foreground="{DynamicResource SystemAccentColor}"
DockPanel.Dock="Left" />

MODIFY
WalletWasabi.Fluent/Controls/PreviewItem.axaml.cs
WalletWasabi.Fluent/Controls/PreviewItem.axaml.cs
using System;
-using System.Reactive.Linq;
using System.Windows.Input;
using Avalonia;
using Avalonia.Controls;
@@ -38,9 +37,8 @@ namespace WalletWasabi.Fluent.Controls
}
});
- this.WhenAnyValue(x => x.CopyParameter)
- .Select(x => !string.IsNullOrEmpty(x?.ToString()))
- .Subscribe(x => CopyButtonVisibility = x);
+ this.WhenAnyValue(x => x.CopyParameter, x => x.IsPointerOver, (cp, apo) => !string.IsNullOrEmpty(cp?.ToString()) && apo)
+ .Subscribe(value => CopyButtonVisibility = value);
}
public string Text

make copy button visible only if the mouse is on the control