-
Notifications
You must be signed in to change notification settings - Fork 58
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
posframe-poshandler-point-bottom-center feature? #131
Comments
Try below poshandler or write your own poshandler.
|
I was looking at For example: (defun posframe-poshandler-point-bottom-left-corner (info)
"Posframe's position handler.
This poshandler function let top left corner of posframe align to
bottom left corner of point.
The structure of INFO can be found in docstring of
`posframe-show'."
(posframe-poshandler-point-1 info)) This is what I came up with, not perfect, needs some work. It does not work (defun my-posframe-poshandler (info)
"Custom poshandler function for Posframe."
(let* ((window (plist-get info :parent-window))
(pos (plist-get info :position))
(pos (if (integerp pos) (posn-at-point pos window) pos))
(pwidth (plist-get info :posframe-width))
(pheight (plist-get info :posframe-height))
(fheight (plist-get info :parent-frame-height))
(fonth (plist-get info :font-height))
(bottom (+ (nth 2 (window-pixel-edges window)) 10))
(x (- (car (posn-x-y pos)) (/ pwidth 2)))
(x (or (and (< x 0) 0) x))
(y (+ (cdr (posn-x-y pos)) (* fonth 3)))
(y (or (and (> (+ y pheight ) bottom) (- y (* 2 pheight))) y)))
(cons x y)))
(let ((hydra-posframe-show-params
'(:internal-border-width 1
:internal-border-color "black"
:poshandler my-posframe-poshandler))
(hydra-hint-display-type 'posframe))
(hydra-org-agenda/body)) |
Hello, thanks for this awesome package.
I was having problems centering the hydras with hints so I decided to go this route.
For small hydras it's not an issue to use the
posframe-poshandler-point-bottom-left-corner
but for bigger ones I would like to center on the cursor above or below. If I'm on the
edge of the screen default to left or right of the cursor.
Is there a way to place the center of the frame above or below the cursor like this?
Thanks
The text was updated successfully, but these errors were encountered: