-
Notifications
You must be signed in to change notification settings - Fork 236
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enhancement: Popup positioning. #36
Comments
Hi Maher, it would be quite easy to support some user-settable offset. Currently, the popup is actually shifted 4px to the right of the caret so that the caret is not shadowed by the popup. The 4px are hard-coded, but could be changed to some user-settable value. Alignment with respect to selection would be more complicated to implement, but is definitely something to consider. |
If there is a way to translate character width and height to pixels then it Which brings me to suggest providing a pixel height and pixel length
|
With the latest snapshot, if you want to position the popup window 10 pixels down from the bottom center of the selection, you can do it like this: Popup popup = new Popup();
area.setPopupWindow(popup);
area.setPopupAlignment(PopupAlignment.SELECTION_BOTTOM_CENTER);
area.setPopupAnchorOffset(new Point2D(0, 10)); |
Thanks! This is what I was looking for!
|
Hi Tomas,
Thanks for adding the popup property. Would be possible to add an alignment or offset methods for that position?
Example use case: selecting a range of text. In some situations, it would make sense to have the pop up centered in the selected range horizontally, and maybe indented down a few lines vertically.. I am not sure how feasible it is to implement. but thought I'll make a suggestion.
Thanks,
Maher
The text was updated successfully, but these errors were encountered: