From e4605cd36113dd3791a487a32d04582d55796286 Mon Sep 17 00:00:00 2001 From: Vincent Zhang Date: Sat, 29 Sep 2018 17:14:43 +0800 Subject: [PATCH] Fix #30: adjust mode-line bars with font size. --- doom-modeline.el | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/doom-modeline.el b/doom-modeline.el index 3e413ed..7599687 100644 --- a/doom-modeline.el +++ b/doom-modeline.el @@ -941,6 +941,10 @@ with `evil-ex-substitute', and/or 4. The number of active `iedit' regions." (when (and (eq op 'set) (integerp val)) (doom-modeline-refresh-bars val doom-modeline-height))))) +(add-hook 'after-setting-font-hook + '(lambda () + (doom-modeline-refresh-bars))) + ;; ;; window number @@ -1087,15 +1091,17 @@ See `mode-line-percent-position'.") ;; (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 (doom-modeline--make-xpm 'doom-modeline-bar (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--make-xpm 'doom-modeline-inactive-bar (or width doom-modeline-bar-width) - (or height doom-modeline-height)))) + (max (or height doom-modeline-height) + (frame-char-height))))) ;;;###autoload (defun doom-modeline-init ()