Reload dashboard when loading theme

To fix dashboard banner background mismatches due to solaire-mode.
This commit is contained in:
Henrik Lissner 2021-05-22 19:56:37 -04:00
parent 5aea22ec31
commit 6e296f3da2

View file

@ -119,6 +119,7 @@ PLIST can have the following properties:
(when (equal (buffer-name) "*scratch*") (when (equal (buffer-name) "*scratch*")
(set-window-buffer nil (doom-fallback-buffer)) (set-window-buffer nil (doom-fallback-buffer))
(+doom-dashboard-reload)) (+doom-dashboard-reload))
(add-hook 'doom-load-theme-hook #'+doom-dashboard-reload-on-theme-change-h)
;; Ensure the dashboard is up-to-date whenever it is switched to or resized. ;; Ensure the dashboard is up-to-date whenever it is switched to or resized.
(add-hook 'window-configuration-change-hook #'+doom-dashboard-resize-h) (add-hook 'window-configuration-change-hook #'+doom-dashboard-resize-h)
(add-hook 'window-size-change-functions #'+doom-dashboard-resize-h) (add-hook 'window-size-change-functions #'+doom-dashboard-resize-h)
@ -333,6 +334,11 @@ What it is set to is controlled by `+doom-dashboard-pwd-policy'."
(concat (directory-file-name new-pwd) (concat (directory-file-name new-pwd)
"/")))))) "/"))))))
(defun +doom-dashboard-reload-on-theme-change-h ()
"Forcibly reload the Doom dashboard when theme changes post-startup."
(when after-init-time
(+doom-dashboard-reload 'force)))
(defun +doom-dashboard-reload (&optional force) (defun +doom-dashboard-reload (&optional force)
"Update the DOOM scratch buffer (or create it, if it doesn't exist)." "Update the DOOM scratch buffer (or create it, if it doesn't exist)."
(when (or (and (not +doom-dashboard-inhibit-refresh) (when (or (and (not +doom-dashboard-inhibit-refresh)