2019-03-01 15:12:27 -05:00
|
|
|
;;; ui/modeline/autoload/modeline.el -*- lexical-binding: t; -*-
|
|
|
|
|
|
|
|
(defvar +modeline--old-bar-height nil)
|
2019-05-13 12:36:22 -04:00
|
|
|
;;;###autoload
|
2019-07-22 04:46:14 +02:00
|
|
|
(defun +modeline-resize-for-font-h ()
|
2019-05-12 21:54:16 -04:00
|
|
|
"Adjust the modeline's height when the font size is changed by
|
|
|
|
`doom/increase-font-size' or `doom/decrease-font-size'.
|
|
|
|
|
|
|
|
Meant for `doom-change-font-size-hook'."
|
2019-03-01 15:12:27 -05:00
|
|
|
(unless +modeline--old-bar-height
|
|
|
|
(setq +modeline--old-bar-height doom-modeline-height))
|
2019-05-12 21:54:16 -04:00
|
|
|
(let ((default-height +modeline--old-bar-height)
|
|
|
|
(scale (or (frame-parameter nil 'font-scale) 0)))
|
2020-02-06 15:30:50 -05:00
|
|
|
(setq doom-modeline-height
|
|
|
|
(if (> scale 0)
|
|
|
|
(+ default-height (* scale doom-font-increment))
|
|
|
|
default-height))))
|
2019-03-01 15:12:27 -05:00
|
|
|
|
|
|
|
;;;###autoload
|
2019-07-18 15:27:20 +02:00
|
|
|
(defun +modeline-update-env-in-all-windows-h (&rest _)
|
2019-03-07 00:11:45 -05:00
|
|
|
"Update version strings in all buffers."
|
2019-03-01 15:12:27 -05:00
|
|
|
(dolist (window (window-list))
|
|
|
|
(with-selected-window window
|
2020-04-25 17:00:57 -04:00
|
|
|
(when (fboundp 'doom-modeline-update-env)
|
|
|
|
(doom-modeline-update-env))
|
2019-03-07 00:11:45 -05:00
|
|
|
(force-mode-line-update))))
|
|
|
|
|
|
|
|
;;;###autoload
|
2019-07-18 15:27:20 +02:00
|
|
|
(defun +modeline-clear-env-in-all-windows-h (&rest _)
|
2019-03-07 00:11:45 -05:00
|
|
|
"Blank out version strings in all buffers."
|
2022-08-12 20:29:19 +02:00
|
|
|
(unless (modulep! +light)
|
2020-04-25 17:00:57 -04:00
|
|
|
(dolist (buffer (buffer-list))
|
|
|
|
(with-current-buffer buffer
|
|
|
|
(setq doom-modeline-env--version
|
|
|
|
(bound-and-true-p doom-modeline-load-string)))))
|
2019-03-07 00:11:45 -05:00
|
|
|
(force-mode-line-update t))
|