mirror of https://github.com/buggins/dlangide.git
Set focus on completion popup to allow for arrow key selection of completion item
Also set focus back to editor after completion popup
This commit is contained in:
parent
317749bee8
commit
2b438dd653
|
@ -83,6 +83,7 @@ class DSourceEdit : SourceEdit {
|
||||||
case IDEActions.InsertCompletion:
|
case IDEActions.InsertCompletion:
|
||||||
EditOperation edit = new EditOperation(EditAction.Replace, getCaretPosition, a.label);
|
EditOperation edit = new EditOperation(EditAction.Replace, getCaretPosition, a.label);
|
||||||
_content.performOperation(edit, this);
|
_content.performOperation(edit, this);
|
||||||
|
setFocus();
|
||||||
return true;
|
return true;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
@ -104,7 +105,9 @@ class DSourceEdit : SourceEdit {
|
||||||
PopupMenu popupMenu = new PopupMenu(completionPopupItem);
|
PopupMenu popupMenu = new PopupMenu(completionPopupItem);
|
||||||
popupMenu.onMenuItemActionListener = this;
|
popupMenu.onMenuItemActionListener = this;
|
||||||
popupMenu.maxHeight(400);
|
popupMenu.maxHeight(400);
|
||||||
|
popupMenu.selectItem(0);
|
||||||
PopupWidget popup = window.showPopup(popupMenu, this, PopupAlign.Point | PopupAlign.Right, textPosToClient(_caretPos).left + left + _leftPaneWidth, textPosToClient(_caretPos).top + top + margins.top);
|
PopupWidget popup = window.showPopup(popupMenu, this, PopupAlign.Point | PopupAlign.Right, textPosToClient(_caretPos).left + left + _leftPaneWidth, textPosToClient(_caretPos).top + top + margins.top);
|
||||||
|
popup.setFocus();
|
||||||
popup.flags = PopupFlags.CloseOnClickOutside;
|
popup.flags = PopupFlags.CloseOnClickOutside;
|
||||||
Log.d("Showing popup at ", textPosToClient(_caretPos).left, " ", textPosToClient(_caretPos).top);
|
Log.d("Showing popup at ", textPosToClient(_caretPos).left, " ", textPosToClient(_caretPos).top);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue