|
|
|
@ -406,6 +406,8 @@ namespace Avalonia.Controls |
|
|
|
if (IsUndoEnabled && _undoRedoHelper.TryGetLastState(out state) && state.Text == Text) |
|
|
|
_undoRedoHelper.UpdateLastState(); |
|
|
|
|
|
|
|
using var _ = _imClient.BeginChange(); |
|
|
|
|
|
|
|
var newValue = e.GetNewValue<int>(); |
|
|
|
SetCurrentValue(SelectionStartProperty, newValue); |
|
|
|
SetCurrentValue(SelectionEndProperty, newValue); |
|
|
|
@ -1216,6 +1218,8 @@ namespace Avalonia.Controls |
|
|
|
|
|
|
|
var keymap = Application.Current!.PlatformSettings!.HotkeyConfiguration; |
|
|
|
|
|
|
|
using var _ = _imClient.BeginChange(); |
|
|
|
|
|
|
|
bool Match(List<KeyGesture> gestures) => gestures.Any(g => g.Matches(e)); |
|
|
|
bool DetectSelection() => e.KeyModifiers.HasAllFlags(keymap.SelectionModifiers); |
|
|
|
|
|
|
|
@ -1547,6 +1551,8 @@ namespace Avalonia.Controls |
|
|
|
var text = Text; |
|
|
|
var clickInfo = e.GetCurrentPoint(this); |
|
|
|
|
|
|
|
using var _ = _imClient.BeginChange(); |
|
|
|
|
|
|
|
if (text != null && (e.Pointer.Type == PointerType.Mouse || e.ClickCount >= 2) && clickInfo.Properties.IsLeftButtonPressed && |
|
|
|
!(clickInfo.Pointer?.Captured is Border)) |
|
|
|
{ |
|
|
|
@ -1631,6 +1637,7 @@ namespace Avalonia.Controls |
|
|
|
{ |
|
|
|
return; |
|
|
|
} |
|
|
|
using var _ = _imClient.BeginChange(); |
|
|
|
|
|
|
|
// selection should not change during pointer move if the user right clicks
|
|
|
|
if (e.Pointer.Captured == _presenter && e.GetCurrentPoint(this).Properties.IsLeftButtonPressed) |
|
|
|
@ -1713,6 +1720,8 @@ namespace Avalonia.Controls |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
using var _ = _imClient.BeginChange(); |
|
|
|
|
|
|
|
if (e.Pointer.Type != PointerType.Mouse && !_isDoubleTapped) |
|
|
|
{ |
|
|
|
var text = Text; |
|
|
|
@ -1857,6 +1866,8 @@ namespace Avalonia.Controls |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
using var _ = _imClient.BeginChange(); |
|
|
|
|
|
|
|
var text = Text ?? string.Empty; |
|
|
|
var selectionStart = SelectionStart; |
|
|
|
var selectionEnd = SelectionEnd; |
|
|
|
@ -2017,6 +2028,8 @@ namespace Avalonia.Controls |
|
|
|
/// </summary>
|
|
|
|
public void SelectAll() |
|
|
|
{ |
|
|
|
using var _ = _imClient.BeginChange(); |
|
|
|
|
|
|
|
SetCurrentValue(SelectionStartProperty, 0); |
|
|
|
SetCurrentValue(SelectionEndProperty, Text?.Length ?? 0); |
|
|
|
} |
|
|
|
@ -2034,6 +2047,8 @@ namespace Avalonia.Controls |
|
|
|
if (IsReadOnly) |
|
|
|
return true; |
|
|
|
|
|
|
|
using var _ = _imClient.BeginChange(); |
|
|
|
|
|
|
|
var (start, end) = GetSelectionRange(); |
|
|
|
|
|
|
|
if (start != end) |
|
|
|
@ -2141,6 +2156,8 @@ namespace Avalonia.Controls |
|
|
|
var text = Text ?? string.Empty; |
|
|
|
var selectionStart = CaretIndex; |
|
|
|
|
|
|
|
using var _ = _imClient.BeginChange(); |
|
|
|
|
|
|
|
MoveHorizontal(-1, true, false, false); |
|
|
|
|
|
|
|
if (SelectionEnd > 0 && |
|
|
|
@ -2160,6 +2177,8 @@ namespace Avalonia.Controls |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
using var _ = _imClient.BeginChange(); |
|
|
|
|
|
|
|
SetCurrentValue(SelectionStartProperty, CaretIndex); |
|
|
|
|
|
|
|
MoveHorizontal(1, true, true, false); |
|
|
|
|