1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-13 22:04:09 +02:00

Fixed some selection issues

This commit is contained in:
Brian Fiete 2020-07-19 11:07:31 -07:00
parent 1e446a655c
commit af9ac0b918

View file

@ -525,7 +525,8 @@ namespace Beefy.widgets
{ {
None, None,
Dragging, Dragging,
ClickedInside ClickedInside,
DraggingInside
} }
public Data mData ~ _.Deref(this); public Data mData ~ _.Deref(this);
@ -798,7 +799,7 @@ namespace Beefy.widgets
} }
else if (!mWidgetWindow.IsKeyDown(KeyCode.Shift)) else if (!mWidgetWindow.IsKeyDown(KeyCode.Shift))
{ {
if ((mSelection != null) && (CursorTextPos >= mSelection.Value.MinPos) && (CursorTextPos <= mSelection.Value.MaxPos)) if ((mSelection != null) && (CursorTextPos > mSelection.Value.MinPos) && (CursorTextPos < mSelection.Value.MaxPos))
{ {
if (hadSelection) if (hadSelection)
{ {
@ -835,7 +836,9 @@ namespace Beefy.widgets
MoveCursorToCoord(x, y); MoveCursorToCoord(x, y);
ClampCursor(); ClampCursor();
if (mDragSelectionKind == .Dragging) if (mDragSelectionKind == .Dragging)
SelectToCursor(); SelectToCursor();
else if (mDragSelectionKind == .ClickedInside)
mDragSelectionKind = .DraggingInside;
} }
} }
@ -2004,8 +2007,11 @@ namespace Beefy.widgets
{ {
String selText = scope String(); String selText = scope String();
GetSelectionText(selText); GetSelectionText(selText);
BFApp.sApp.SetClipboardText(selText); if (!selText.IsEmpty)
DeleteSelection(); {
BFApp.sApp.SetClipboardText(selText);
DeleteSelection();
}
} }
} }
@ -2013,7 +2019,8 @@ namespace Beefy.widgets
{ {
String selText = scope String(); String selText = scope String();
GetSelectionText(selText); GetSelectionText(selText);
BFApp.sApp.SetClipboardText(selText); if (!selText.IsEmpty)
BFApp.sApp.SetClipboardText(selText);
} }
public void PasteText() public void PasteText()