copy popupmenuitem removed
MODIFY
WalletWasabi.Gui/Controls/ExtendedTextBox.cs
WalletWasabi.Gui/Controls/ExtendedTextBox.cs
@@ -105,6 +105,8 @@ namespace WalletWasabi.Gui.Controls
}
}
+ protected virtual bool IsCopyEnabled => true;
+
protected override void OnTemplateApplied(TemplateAppliedEventArgs e)
{
base.OnTemplateApplied(e);
@@ -113,40 +115,40 @@ namespace WalletWasabi.Gui.Controls
{
DataContext = this,
};
- var pastePresenter = new DrawingPresenter
+
+ ContextMenu.Items = new Avalonia.Controls.Controls();
+
+ if (IsCopyEnabled)
+ {
+ var copyPresenter = new DrawingPresenter
{
Drawing = new GeometryDrawing
{
Brush = Brushes.LightGray,
Geometry = Geometry.Parse(
- @"M19,20H5V4H7V7H17V4H19M12,2A1,1 0 0,1 13,3A1,1 0 0,1 12,4A1,1 0 0,1 11,3A1,1 0 0,1 12,2M19,2H14.82C14.4,0.84
- 13.3,0 12,0C10.7,0 9.6,0.84 9.18,2H5A2,2 0 0,0 3,4V20A2,2 0 0,0 5,22H19A2,2 0 0,0 21,20V4A2,2 0 0,0 19,2Z")
+ "M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z")
},
Width = 16,
- Height = 16,
+ Height = 16
};
- var copyPresenter = new DrawingPresenter
+ (ContextMenu.Items as Avalonia.Controls.Controls).Add(new MenuItem { Header = "Copy", Command = CopyCommand, Icon = copyPresenter });
+ }
+
+ if (!IsReadOnly)
+ {
+ var pastePresenter = new DrawingPresenter
{
Drawing = new GeometryDrawing
{
Brush = Brushes.LightGray,
Geometry = Geometry.Parse(
- "M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z")
+ @"M19,20H5V4H7V7H17V4H19M12,2A1,1 0 0,1 13,3A1,1 0 0,1 12,4A1,1 0 0,1 11,3A1,1 0 0,1 12,2M19,2H14.82C14.4,0.84
+ 13.3,0 12,0C10.7,0 9.6,0.84 9.18,2H5A2,2 0 0,0 3,4V20A2,2 0 0,0 5,22H19A2,2 0 0,0 21,20V4A2,2 0 0,0 19,2Z")
},
Width = 16,
- Height = 16
- };
-
- _pasteItem = new MenuItem { Header = "Paste", Command = PasteCommand, Icon = pastePresenter };
-
- ContextMenu.Items = new Avalonia.Controls.Controls
- {
- new MenuItem { Header = "Copy", Command = CopyCommand, Icon = copyPresenter }
+ Height = 16,
};
-
- if (!IsReadOnly)
- {
- (ContextMenu.Items as Avalonia.Controls.Controls).Add(_pasteItem);
+ (ContextMenu.Items as Avalonia.Controls.Controls).Add(new MenuItem { Header = "Paste", Command = PasteCommand, Icon = pastePresenter });
}
}
}

MODIFY
WalletWasabi.Gui/Controls/NoparaPasswordBox.cs
WalletWasabi.Gui/Controls/NoparaPasswordBox.cs
@@ -75,6 +75,8 @@ namespace WalletWasabi.Gui.Controls
}
}
+ protected override bool IsCopyEnabled => false;
+
public NoparaPasswordBox()
{
this.GetObservable(PasswordProperty).Subscribe(x =>

copy popupmenuitem removed