turn off selectability
MODIFY
WalletWasabi.Gui/Controls/MultiTextBox.cs
WalletWasabi.Gui/Controls/MultiTextBox.cs
@@ -39,6 +39,9 @@ namespace WalletWasabi.Gui.Controls
public static readonly StyledProperty<bool> TextVisibleProperty =
AvaloniaProperty.Register<MultiTextBox, bool>(nameof(TextVisible), defaultBindingMode: BindingMode.TwoWay);
+ public static readonly StyledProperty<bool> IsSelectableProperty =
+ AvaloniaProperty.Register<MultiTextBox, bool>(nameof(IsSelectable), defaultBindingMode: BindingMode.TwoWay);
+
public bool ClipboardNotificationVisible
{
get => GetValue(ClipboardNotificationVisibleProperty);
@@ -69,12 +72,19 @@ namespace WalletWasabi.Gui.Controls
set => SetValue(TextVisibleProperty, value);
}
+ public bool IsSelectable
+ {
+ get => GetValue(IsSelectableProperty);
+ set => SetValue(IsSelectableProperty, value);
+ }
+
public ReactiveCommand<Unit, Unit> CopyToClipboardCommand { get; }
public MultiTextBox()
{
ClipboardNotificationVisible = false;
ClipboardNotificationOpacity = 0;
+ IsSelectable = true;
Disposables = new CompositeDisposable();
@@ -113,6 +123,22 @@ namespace WalletWasabi.Gui.Controls
{
TextVisible = !visible;
});
+
+ this.WhenAnyValue(x => x.SelectionStart).Subscribe(s =>
+ {
+ if (!IsSelectable)
+ {
+ SelectionStart = 0;
+ }
+ });
+
+ this.WhenAnyValue(x => x.SelectionEnd).Subscribe(s =>
+ {
+ if (!IsSelectable)
+ {
+ SelectionEnd = 0;
+ }
+ });
}
public async Task CopyToClipboardAsync()
@@ -195,6 +221,11 @@ namespace WalletWasabi.Gui.Controls
}
}
+ protected override Task CopyAsync()
+ {
+ return CopyToClipboardAsync();
+ }
+
protected override void OnDetachedFromVisualTree(VisualTreeAttachmentEventArgs e)
{
base.OnDetachedFromVisualTree(e);

MODIFY
WalletWasabi.Gui/Controls/WalletExplorer/TransactionViewerView.xaml
WalletWasabi.Gui/Controls/WalletExplorer/TransactionViewerView.xaml
</Grid.RowDefinitions>
<DockPanel Grid.Row="0" LastChildFill="True" Margin="0 8">
- <controls:MultiTextBox Text="{Binding PsbtJsonText}" CopyOnClick="False" IsReadOnly="True" TextWrapping="Wrap" AcceptsReturn="True" />
+ <controls:MultiTextBox Text="{Binding PsbtJsonText}" CopyOnClick="False" IsSelectable="False" IsReadOnly="True" TextWrapping="Wrap" AcceptsReturn="True" />
</DockPanel>
<DockPanel Grid.Row="1" LastChildFill="True" Margin="0 8">
<TextBlock DockPanel.Dock="Top" Text="Transaction Hex" FontWeight="Bold" Margin="0 0 0 8" />
- <controls:MultiTextBox Text="{Binding TransactionHexText}" CopyOnClick="True" IsReadOnly="True" TextWrapping="Wrap" AcceptsReturn="True" />
+ <controls:MultiTextBox Text="{Binding TransactionHexText}" CopyOnClick="True" IsSelectable="False" IsReadOnly="True" TextWrapping="Wrap" AcceptsReturn="True" />
</DockPanel>
<DockPanel Grid.Row="2" LastChildFill="True" Margin="0 8">
<TextBlock DockPanel.Dock="Top" Text="PSBT Base64 String" FontWeight="Bold" Margin="0 0 0 8" />
- <controls:MultiTextBox Text="{Binding PsbtBase64Text}" CopyOnClick="True" IsReadOnly="True" TextWrapping="Wrap" AcceptsReturn="True" />
+ <controls:MultiTextBox Text="{Binding PsbtBase64Text}" CopyOnClick="True" IsSelectable="False" IsReadOnly="True" TextWrapping="Wrap" AcceptsReturn="True" />
</DockPanel>
</Grid>
</controls:GroupBox>

turn off selectability