Fix #30: adjust mode-line bars with font size.

This commit is contained in:
Vincent Zhang 2018-09-29 17:14:43 +08:00
parent 973e9ce7c7
commit e4605cd361

View file

@ -941,6 +941,10 @@ with `evil-ex-substitute', and/or 4. The number of active `iedit' regions."
(when (and (eq op 'set) (integerp val)) (when (and (eq op 'set) (integerp val))
(doom-modeline-refresh-bars val doom-modeline-height))))) (doom-modeline-refresh-bars val doom-modeline-height)))))
(add-hook 'after-setting-font-hook
'(lambda ()
(doom-modeline-refresh-bars)))
;; ;;
;; window number ;; window number
@ -1087,15 +1091,17 @@ See `mode-line-percent-position'.")
;; ;;
(defun doom-modeline-refresh-bars (&optional width height) (defun doom-modeline-refresh-bars (&optional width height)
"Refreash mode-line bars with `WIDTH' and `HEIGHT'." "Refresh mode-line bars with `WIDTH' and `HEIGHT'."
(setq doom-modeline--bar-active (setq doom-modeline--bar-active
(doom-modeline--make-xpm 'doom-modeline-bar (doom-modeline--make-xpm 'doom-modeline-bar
(or width doom-modeline-bar-width) (or width doom-modeline-bar-width)
(or height doom-modeline-height)) (max (or height doom-modeline-height)
(frame-char-height)))
doom-modeline--bar-inactive doom-modeline--bar-inactive
(doom-modeline--make-xpm 'doom-modeline-inactive-bar (doom-modeline--make-xpm 'doom-modeline-inactive-bar
(or width doom-modeline-bar-width) (or width doom-modeline-bar-width)
(or height doom-modeline-height)))) (max (or height doom-modeline-height)
(frame-char-height)))))
;;;###autoload ;;;###autoload
(defun doom-modeline-init () (defun doom-modeline-init ()