2018-03-02 22:34:43 -05:00
|
|
|
;;; ui/doom-modeline/autoload.el -*- lexical-binding: t; -*-
|
|
|
|
|
2018-06-02 21:40:57 +02:00
|
|
|
(defvar +doom-modeline--old-bar-height nil)
|
2018-03-02 22:34:43 -05:00
|
|
|
;;;###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'."
|
2018-06-02 21:40:57 +02:00
|
|
|
(unless +doom-modeline--old-bar-height
|
|
|
|
(setq +doom-modeline--old-bar-height +doom-modeline-height))
|
|
|
|
(let ((default-height +doom-modeline--old-bar-height))
|
2018-05-04 10:32:46 +02:00
|
|
|
(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)))
|
2018-06-02 21:40:57 +02:00
|
|
|
(setq +doom-modeline-height (ceiling (* default-height ratio 0.75))))
|
2018-05-04 10:32:46 +02:00
|
|
|
(setq +doom-modeline-height default-height))
|
|
|
|
;; already has a variable watcher in Emacs 26+
|
|
|
|
(unless EMACS26+ (+doom-modeline|refresh-bars))))
|
2018-03-02 22:34:43 -05:00
|
|
|
|