diff --git a/modules/completion/helm/autoload/posframe.el b/modules/completion/helm/autoload/posframe.el index e274ad47a..308679c74 100644 --- a/modules/completion/helm/autoload/posframe.el +++ b/modules/completion/helm/autoload/posframe.el @@ -16,17 +16,40 @@ bottom, which is easier on the eyes on big displays." ;;;###autoload (defun +helm-posframe-display (buffer &optional _resume) "TODO" - (require 'posframe) (setq helm--buffer-in-new-frame-p t) - (posframe-show - (setq +helm--posframe-buffer buffer) - :position (point) - :poshandler +helm-posframe-handler - :override-parameters +helm-posframe-parameters) - (unless (or (null +helm-posframe-text-scale) - (= +helm-posframe-text-scale 0)) - (with-current-buffer buffer - (text-scale-set +helm-posframe-text-scale)))) + (let ((solaire-p (bound-and-true-p solaire-mode)) + (params (copy-sequence +helm-posframe-parameters))) + (let-alist params + (require 'posframe) + (posframe-show + (setq +helm--posframe-buffer buffer) + :position (point) + :poshandler +helm-posframe-handler + :width + (max (cl-typecase .width + (integer .width) + (float (truncate (* (frame-width) .width))) + (function (funcall .width)) + (t 0)) + .min-width) + :height + (max (cl-typecase .height + (integer .height) + (float (truncate (* (frame-height) .height))) + (function (funcall .height)) + (t 0)) + .min-height) + :override-parameters + (dolist (p '(width height min-width min-height) params) + (setq params (delq (assq p params) params))))) + ;; + (unless (or (null +helm-posframe-text-scale) + (= +helm-posframe-text-scale 0)) + (with-current-buffer buffer + (when (and (featurep 'solaire-mode) + (not solaire-p)) + (solaire-mode +1)) + (text-scale-set +helm-posframe-text-scale))))) ;;;###autoload (defun +helm|posframe-cleanup () diff --git a/modules/completion/helm/config.el b/modules/completion/helm/config.el index 27bd78ac0..02159e05f 100644 --- a/modules/completion/helm/config.el +++ b/modules/completion/helm/config.el @@ -26,10 +26,10 @@ be negative.") (defvar +helm-posframe-parameters '((internal-border-width . 8) - (min-width . 80) - (min-height . 16) (width . 0.5) - (height . 0.55)) + (height . 0.35) + (min-width . 80) + (min-height . 16)) "TODO")