From 4586325327b4b1ad5885c91437a774e45332657a Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Mon, 25 May 2026 13:15:21 -0500 Subject: feat(dashboard): render the butterfly banner with a transparency mask The dashboard banner showed the butterfly PNG without its transparency, because the image descriptor was built before the mask props were set. I moved the banner setup (dashboard-startup-banner, dashboard-banner-logo-title) ahead of dashboard-setup-startup-hook and added dashboard-image-extra-props with :mask heuristic, so the mask is in place when the startup hook builds the buffer. If a *dashboard* buffer already exists I refresh it, so the change shows without a restart. I also re-encoded the PNG smaller and kept the previous encoding as M-x_butterfly.png.bak. --- assets/M-x_butterfly.png | Bin 92971 -> 75822 bytes assets/M-x_butterfly.png.bak | Bin 0 -> 92971 bytes modules/dashboard-config.el | 14 ++++++++++---- 3 files changed, 10 insertions(+), 4 deletions(-) create mode 100644 assets/M-x_butterfly.png.bak diff --git a/assets/M-x_butterfly.png b/assets/M-x_butterfly.png index 4e6a26b5..af86d67a 100644 Binary files a/assets/M-x_butterfly.png and b/assets/M-x_butterfly.png differ diff --git a/assets/M-x_butterfly.png.bak b/assets/M-x_butterfly.png.bak new file mode 100644 index 00000000..4e6a26b5 Binary files /dev/null and b/assets/M-x_butterfly.png.bak differ diff --git a/modules/dashboard-config.el b/modules/dashboard-config.el index 4602cc15..ac511b5b 100644 --- a/modules/dashboard-config.el +++ b/modules/dashboard-config.el @@ -170,6 +170,14 @@ window." dashboard-insert-items)) :config + ;; == banner + ;; Set image props before `dashboard-setup-startup-hook' can build the + ;; dashboard buffer; otherwise the startup image descriptor may miss the + ;; transparency mask. + (setq dashboard-startup-banner (concat user-emacs-directory "assets/M-x_butterfly.png")) + (setq dashboard-image-extra-props '(:mask heuristic)) + (setq dashboard-banner-logo-title "Emacs: The Editor That Saves Your Soul") + ;; == general (dashboard-setup-startup-hook) ;; run dashboard post emacs init (cj/make-buffer-undead "*dashboard*") ;; make this buffer unkillable @@ -185,16 +193,14 @@ window." (setq recentf-exclude '("/emms/history")) ;; exclude EMMS history from recent files (setq dashboard-set-footer nil) ;; don't show footer and quotes - ;; == banner - (setq dashboard-startup-banner (concat user-emacs-directory "assets/M-x_butterfly.png")) - (setq dashboard-banner-logo-title "Emacs: The Editor That Saves Your Soul") - ;; == navigation (setq dashboard-set-navigator t) (setq dashboard-navigator-buttons (cj/dashboard--navigator-rows)) ;; == content (setq dashboard-show-shortcuts nil) ;; don't show dashboard item abbreviations + (when (get-buffer "*dashboard*") + (dashboard-refresh-buffer)) ) ;; end use-package dashboard ;; ------------------------ Dashboard Keybindings ------------------------------ -- cgit v1.2.3