mirror of
https://github.com/vale981/doom-modeline
synced 2025-03-05 09:21:38 -05:00
Add a minimum height for the hud's middle part (#445)
This looks nicer, and it also makes sure it is not possible to try to draw an image with a negative height for the middle part (which might happen if window-start and buffer-size are out of sync).
This commit is contained in:
parent
3b393766f4
commit
0466d88d71
1 changed files with 13 additions and 0 deletions
|
@ -164,6 +164,14 @@ It's only respected in GUI."
|
|||
:type 'boolean
|
||||
:group 'doom-modeline)
|
||||
|
||||
(defcustom doom-modeline-hud-min-height 2
|
||||
"Minimum height in pixels of the \"thumb\" of the hud.
|
||||
Only respected in GUI."
|
||||
:type 'integer
|
||||
:set (lambda (sym val)
|
||||
(set sym (if (> val 1) val 1)))
|
||||
:group 'doom-modeline)
|
||||
|
||||
(defcustom doom-modeline-window-width-limit fill-column
|
||||
"The limit of the window width.
|
||||
|
||||
|
@ -1124,6 +1132,11 @@ TOP-MARGIN and BOTTOM-MARGIN are the size of the margin above and below the bar,
|
|||
respectively."
|
||||
(when (and (display-graphic-p)
|
||||
(image-type-available-p 'pbm))
|
||||
(let ((min-height (min height doom-modeline-hud-min-height)))
|
||||
(unless (> (- height top-margin bottom-margin) min-height)
|
||||
(let ((margin (- height min-height)))
|
||||
(setq top-margin (/ (* margin top-margin) (+ top-margin bottom-margin))
|
||||
bottom-margin (- margin top-margin)))))
|
||||
(propertize
|
||||
" " 'display
|
||||
(let ((color1 (or (face-background face1 nil t) "None"))
|
||||
|
|
Loading…
Add table
Reference in a new issue