mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-09 20:12:21 +02:00
Merge pull request #988 from EinBurgbauer/editwidget-readonly-fix
fix readonly editwidget deletion
This commit is contained in:
commit
f34424a61d
1 changed files with 36 additions and 33 deletions
|
@ -1699,6 +1699,8 @@ namespace Beefy.widgets
|
||||||
base.KeyChar(keyChar);
|
base.KeyChar(keyChar);
|
||||||
|
|
||||||
if (keyChar == '\x7F') // Ctrl+Backspace
|
if (keyChar == '\x7F') // Ctrl+Backspace
|
||||||
|
{
|
||||||
|
if (!CheckReadOnly())
|
||||||
{
|
{
|
||||||
int line;
|
int line;
|
||||||
int lineChar;
|
int lineChar;
|
||||||
|
@ -1713,6 +1715,7 @@ namespace Beefy.widgets
|
||||||
mData.mUndoManager.Add(action);
|
mData.mUndoManager.Add(action);
|
||||||
action.mCursorTextPos = (.)startIdx;
|
action.mCursorTextPos = (.)startIdx;
|
||||||
PhysDeleteSelection(true);
|
PhysDeleteSelection(true);
|
||||||
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -1721,9 +1724,6 @@ namespace Beefy.widgets
|
||||||
|
|
||||||
mCursorBlinkTicks = 0;
|
mCursorBlinkTicks = 0;
|
||||||
|
|
||||||
if (useChar == '\x7F') // Ctrl+Backspace
|
|
||||||
useChar = '\b';
|
|
||||||
|
|
||||||
if (useChar == '\b')
|
if (useChar == '\b')
|
||||||
{
|
{
|
||||||
if (!CheckReadOnly())
|
if (!CheckReadOnly())
|
||||||
|
@ -2510,6 +2510,8 @@ namespace Beefy.widgets
|
||||||
break;
|
break;
|
||||||
case KeyCode.Delete:
|
case KeyCode.Delete:
|
||||||
if (mWidgetWindow.IsKeyDown(.Control))
|
if (mWidgetWindow.IsKeyDown(.Control))
|
||||||
|
{
|
||||||
|
if (!CheckReadOnly())
|
||||||
{
|
{
|
||||||
if (mWidgetWindow.IsKeyDown(.Shift))
|
if (mWidgetWindow.IsKeyDown(.Shift))
|
||||||
{
|
{
|
||||||
|
@ -2537,6 +2539,7 @@ namespace Beefy.widgets
|
||||||
mData.mUndoManager.Add(action);
|
mData.mUndoManager.Add(action);
|
||||||
action.mCursorTextPos = (.)startIdx;
|
action.mCursorTextPos = (.)startIdx;
|
||||||
PhysDeleteSelection(true);
|
PhysDeleteSelection(true);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue