update preview on delete or Ctrl+[S|V|Z]

This commit is contained in:
johan.forsberg 2023-11-05 01:14:30 +01:00
parent 0f1a9f4b8c
commit 8f9974479a
2 changed files with 21 additions and 2 deletions

View File

@ -34,8 +34,8 @@
"dependencies": {
"inilike": "~>1.2.2",
"icontheme": "~>1.2.3",
"arsd-official:dom": "~>11.1.0",
"arsd-official:image_files": "~>11.1.0"
"arsd-official:dom": "11.2.3",
"arsd-official:image_files": "11.2.3"
},
"subPackages": [

View File

@ -468,6 +468,25 @@ class EditFrame : AppFrame
_editor = new DMLSourceEdit();
_editor.text = SAMPLE_SOURCE_CODE;
_editor.keyEvent = delegate(Widget w, KeyEvent e) {
if (e.action == KeyAction.KeyUp)
{
if ((e.keyCode == KeyCode.DEL)
|| (e.flags == KeyFlag.LControl && e.keyCode == KeyCode.KEY_S)
|| (e.flags == KeyFlag.LControl && e.keyCode == KeyCode.KEY_V)
|| (e.flags == KeyFlag.LControl && e.keyCode == KeyCode.KEY_Z))
{
updatePreview();
}
else
{
Log.d(e);
}
}
return false;
};
auto editorDockWin = new DockWindow("editor");
editorDockWin.layoutWidth = makePercentSize(50);
editorDockWin.bodyWidget = _editor;