Wrap receive addresses labels
MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/Receive/AddressViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/Receive/AddressViewModel.cs
+using System.Collections.Generic;
+using System.Linq;
using System.Reactive;
using System.Windows.Input;
using Avalonia;
using NBitcoin;
using ReactiveUI;
-using WalletWasabi.Blockchain.Analysis.Clustering;
using WalletWasabi.Blockchain.Keys;
using WalletWasabi.Wallets;
@@ -11,13 +12,14 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Receive
{
public partial class AddressViewModel : ViewModelBase
{
- [AutoNotify] private SmartLabel _label;
[AutoNotify] private string _address;
public AddressViewModel(ReceiveAddressesViewModel parent, Wallet wallet, HdPubKey model, Network network)
{
_address = model.GetP2wpkhAddress(network).ToString();
- _label = model.Label;
+
+ Label = model.Label.Take(1).ToList();
+ FilteredLabel = model.Label.Skip(1).ToList();
CopyAddressCommand =
ReactiveCommand.CreateFromTask(async () => await Application.Current.Clipboard.SetTextAsync(Address));
@@ -39,5 +41,9 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Receive
public ICommand EditLabelCommand { get; }
public ReactiveCommand<Unit, Unit> NavigateCommand { get; }
+
+ public List<string> FilteredLabel { get; }
+
+ public List<string> Label { get; }
}
}
\ No newline at end of file

MODIFY
WalletWasabi.Fluent/Views/Wallets/Receive/ReceiveAddressesView.axaml
WalletWasabi.Fluent/Views/Wallets/Receive/ReceiveAddressesView.axaml
<DataGrid.Columns>
<DataGridTemplateColumn Header="Labels"
- Width="*"
+ Width="Auto"
CanUserSort="True"
SortMemberPath="Label">
<DataGridTemplateColumn.CellTemplate>
<PathIcon Data="{StaticResource edit_regular}" Classes="addressActionIcon" />
</Button>
<c:PrivacyContentControl PrivacyReplacementMode="Text" NumberOfPrivacyChars="15" VerticalAlignment="Center">
- <c:TagsBox Padding="0" IsReadOnly="True" Items="{Binding Label}" />
+ <DockPanel LastChildFill="False">
+ <c:TagsBox Padding="0"
+ Margin="0"
+ MinWidth="0"
+ BorderThickness="0"
+ DockPanel.Dock="Left"
+ IsReadOnly="True"
+ Items="{Binding Label}"
+ HorizontalAlignment="Stretch"
+ VerticalAlignment="Center" />
+ <Button Classes="labelFlyout"
+ DockPanel.Dock="Left"
+ IsVisible="{Binding !!FilteredLabel.Count}"
+ Content="..."
+ Margin="0 4 0 0">
+ <Button.Flyout>
+ <Flyout Placement="BottomEdgeAlignedLeft" ShowMode="TransientWithDismissOnPointerMoveAway">
+ <c:TagsBox IsReadOnly="True"
+ Items="{Binding FilteredLabel}" />
+ </Flyout>
+ </Button.Flyout>
+ <ToolTip.Tip>
+ <Panel>
+ <c:TagsBox IsReadOnly="True"
+ Margin="4,6,0,0"
+ Items="{Binding FilteredLabel}" />
+ </Panel>
+ </ToolTip.Tip>
+ </Button>
+ </DockPanel>
</c:PrivacyContentControl>
</DockPanel>
</DataTemplate>

Wrap receive addresses labels