diff --git a/modules/ui/doom-modeline/autoload.el b/modules/ui/doom-modeline/autoload.el new file mode 100644 index 000000000..ddebf6a9b --- /dev/null +++ b/modules/ui/doom-modeline/autoload.el @@ -0,0 +1,17 @@ +;;; ui/doom-modeline/autoload.el -*- lexical-binding: t; -*- + +(defvar +doom-modeline--old-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'." + (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--old-height +doom-modeline-height + +doom-modeline-height (ceiling (* +doom-modeline--old-height ratio)))) + (setq +doom-modeline-height +doom-modeline--old-height)) + (+doom-modeline|init)) + diff --git a/modules/ui/doom-modeline/config.el b/modules/ui/doom-modeline/config.el index 1532b9197..e5f352e26 100644 --- a/modules/ui/doom-modeline/config.el +++ b/modules/ui/doom-modeline/config.el @@ -619,11 +619,12 @@ Returns \"\" to not break --no-window-system." (setq +doom-modeline--bar-active (+doom-modeline--make-xpm 'doom-modeline-bar) +doom-modeline--bar-inactive (+doom-modeline--make-xpm 'doom-modeline-inactive-bar)) - ;; These buffers are already created and don't get modelines. For the love of - ;; Emacs, someone give the man a modeline! - (dolist (bname '("*scratch*" "*Messages*")) - (with-current-buffer bname - (doom-set-modeline 'main)))) + (unless after-init-time + ;; These buffers are already created and don't get modelines. For the love + ;; of Emacs, someone give the man a modeline! + (dolist (bname '("*scratch*" "*Messages*")) + (with-current-buffer bname + (doom-set-modeline 'main))))) (defun +doom-modeline|set-special-modeline () (doom-set-modeline 'special)) @@ -647,3 +648,6 @@ Returns \"\" to not break --no-window-system." (add-hook 'image-mode-hook #'+doom-modeline|set-media-modeline) (add-hook 'circe-mode-hook #'+doom-modeline|set-special-modeline) + +;; +(add-hook 'doom-big-font-mode-hook #'+doom-modeline|resize-for-big-font)