Handling mouse cursor according to paste, select all or normal textbox operation
MODIFY
WalletWasabi.Gui/Behaviors/PasteAddressOnClickBehavior.cs
WalletWasabi.Gui/Behaviors/PasteAddressOnClickBehavior.cs
@@ -35,16 +35,19 @@ namespace WalletWasabi.Gui.Behaviors
{
ToolTip.SetTip(AssociatedObject, _originalToolTipText);
ToolTip.SetIsOpen(AssociatedObject, false);
+ AssociatedObject.Cursor = new Avalonia.Input.Cursor(Avalonia.Input.StandardCursorType.Ibeam);
}
break;
case TextBoxState.AddressInsert:
{
ToolTip.SetTip(AssociatedObject, "Click to paste address from clipboard");
+ AssociatedObject.Cursor = new Avalonia.Input.Cursor(Avalonia.Input.StandardCursorType.Arrow);
}
break;
case TextBoxState.SelectAll:
{
ToolTip.SetTip(AssociatedObject, "Click to select all");
+ AssociatedObject.Cursor = new Avalonia.Input.Cursor(Avalonia.Input.StandardCursorType.Arrow);
}
break;
@@ -86,7 +89,29 @@ namespace WalletWasabi.Gui.Behaviors
})
};
-
+ _disposables.Add(
+ AssociatedObject.GetObservable(TextBox.PointerMovedEvent).Subscribe(pointer =>
+ {
+ switch (MyTextBoxState)
+ {
+ case TextBoxState.NormalTextBoxOperation:
+ {
+ AssociatedObject.Cursor = new Avalonia.Input.Cursor(Avalonia.Input.StandardCursorType.Ibeam);
+ }
+ break;
+ case TextBoxState.AddressInsert:
+ {
+ AssociatedObject.Cursor = new Avalonia.Input.Cursor(Avalonia.Input.StandardCursorType.Arrow);
+ }
+ break;
+ case TextBoxState.SelectAll:
+ {
+ AssociatedObject.Cursor = new Avalonia.Input.Cursor(Avalonia.Input.StandardCursorType.Arrow);
+ }
+ break;
+ }
+ })
+ );
_disposables.Add(
AssociatedObject.GetObservable(TextBox.PointerReleasedEvent).Subscribe(pointer =>

Handling mouse cursor according to paste, select all or normal textbox operation