;;; ui/doom-modeline/autoload.el -*- lexical-binding: t; -*-

;;;###autoload
(defun +doom-modeline|resize-for-big-font ()
  "Adjust the modeline's height when `doom-big-font-mode' is enabled. This was
made to be added to `doom-big-font-mode-hook'."
  (let ((default-height (default-value '+doom-modeline-height)))
    (if doom-big-font-mode
        (let* ((font-size (font-get doom-font :size))
               (big-size (font-get doom-big-font :size))
               (ratio (/ (float big-size) font-size)))
          (setq +doom-modeline-height (ceiling (* default-height ratio))))
      (setq +doom-modeline-height default-height))
    ;; already has a variable watcher in Emacs 26+
    (unless EMACS26+ (+doom-modeline|refresh-bars))))


;;; ui/doom-modeline/autoload.el -*- lexical-binding: t; -*-

(defvar +doom-modeline--old-bar-height nil)
;;;###autoload
(defun +doom-modeline|resize-for-big-font ()
  "Adjust the modeline's height when `doom-big-font-mode' is enabled. This was
made to be added to `doom-big-font-mode-hook'."
  (unless +doom-modeline--old-bar-height
    (setq +doom-modeline--old-bar-height +doom-modeline-height))
  (let ((default-height +doom-modeline--old-bar-height))
    (if doom-big-font-mode
        (let* ((font-size (font-get doom-font :size))
               (big-size (font-get doom-big-font :size))
               (ratio (/ (float big-size) font-size)))
          (setq +doom-modeline-height (ceiling (* default-height ratio 0.75))))
      (setq +doom-modeline-height default-height))
    ;; already has a variable watcher in Emacs 26+
    (unless EMACS26+ (+doom-modeline|refresh-bars))))


Fix modeline growing incrementally on big font mode
Fix modeline growing incrementally on big font mode

Fixes #575

UndeadKernel/emacs_doom,hlissner/.emacs.d,hlissner/doom-emacs,UndeadKernel/emacs_doom,hlissner/.emacs.d,hlissner/.emacs.d,UndeadKernel/emacs_doom,UndeadKernel/emacs_doom,hlissner/.emacs.d,hlissner/doom-emacs,hlissner/doom-emacs,hlissner/.emacs.d,UndeadKernel/emacs_doom,hlissner/doom-emacs,hlissner/.emacs.d,hlissner/doom-emacs,hlissner/doom-emacs,hlissner/.emacs.d,hlissner/doom-emacs,hlissner/.emacs.d,UndeadKernel/emacs_doom,UndeadKernel/emacs_doom