fixes editor key handling, file dialog

This commit is contained in:
Vadim Lopatin 2017-09-08 15:07:01 +03:00
parent 8d84223099
commit d382cbf483
2 changed files with 7 additions and 2 deletions

View File

@ -898,6 +898,7 @@ class FilePathPanelItem : HorizontalLayout {
addChild(_button); addChild(_button);
margins(Rect(2.pointsToPixels + 1, 0, 2.pointsToPixels + 1, 0)); margins(Rect(2.pointsToPixels + 1, 0, 2.pointsToPixels + 1, 0));
} }
private bool onTextClick(Widget src) { private bool onTextClick(Widget src) {
if (onPathSelectionListener.assigned) if (onPathSelectionListener.assigned)
return onPathSelectionListener(_path); return onPathSelectionListener(_path);
@ -1134,6 +1135,10 @@ class FileNameEditLine : HorizontalLayout {
/// editor content is changed /// editor content is changed
Signal!EditableContentChangeListener contentChange; Signal!EditableContentChangeListener contentChange;
@property ref Signal!EditorActionHandler editorAction() {
return _edFileName.editorAction;
}
this(string ID = null) { this(string ID = null) {
super(ID); super(ID);
_caption = UIString.fromId("TITLE_OPEN_FILE"c).value; _caption = UIString.fromId("TITLE_OPEN_FILE"c).value;

View File

@ -1624,6 +1624,7 @@ class EditWidgetBase : ScrollWidgetBase, EditableContentListener, MenuItemAction
return true; return true;
case SelectAll: case SelectAll:
selectAll(); selectAll();
ensureCaretVisible();
return true; return true;
case ToggleBookmark: case ToggleBookmark:
if (_content.multiline) { if (_content.multiline) {
@ -1654,7 +1655,6 @@ class EditWidgetBase : ScrollWidgetBase, EditableContentListener, MenuItemAction
_selectionRange.start.pos = 0; _selectionRange.start.pos = 0;
_selectionRange.end = _content.lineEnd(_content.length - 1); _selectionRange.end = _content.lineEnd(_content.length - 1);
_caretPos = _selectionRange.end; _caretPos = _selectionRange.end;
ensureCaretVisible();
requestActionsUpdate(); requestActionsUpdate();
} }
@ -1809,7 +1809,7 @@ class EditWidgetBase : ScrollWidgetBase, EditableContentListener, MenuItemAction
// return true; // return true;
//} //}
bool res = super.onKeyEvent(event); bool res = super.onKeyEvent(event);
if (focused) startCaretBlinking(); //if (focused) startCaretBlinking();
return res; return res;
} }