From b6a8d5d653c15437c7c3e8a580e00c4770e4124b Mon Sep 17 00:00:00 2001 From: JSDurand Date: Fri, 30 Dec 2022 12:33:44 +0800 Subject: modeline: adapt the face once again * modeline.el (modeline-dashboard-format-right, durand-major-global-mode) (modeline-format-major-mode): Tried some tricks, but I still use a white color in the end. --- modeline.el | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) (limited to 'modeline.el') diff --git a/modeline.el b/modeline.el index 683b09d..4fda761 100644 --- a/modeline.el +++ b/modeline.el @@ -71,7 +71,8 @@ (defun modeline-dashboard-format-right () "The right part of the mode line for the dashboard." (declare (side-effect-free t) (pure t)) - (let ((face (cond ((modeline-active-window-p) 'doom-modeline-buffer-major-mode) + (let ((face (cond ((modeline-active-window-p) + 'durand-major-global-mode) ('mode-line-inactive)))) (concat (modeline-propertize @@ -477,25 +478,32 @@ This will be displayed in the mode line." "/Users/durand/elisp_packages/protesilaos/modus-themes/") (&rest body) t) +(defface durand-major-global-mode + (modus-themes-with-colors + (list + (list + '((class color) (min-colors 256)) + :inherit 'mode-line-active))) + "The face used for displaying the major mode and the global mode +string in the mode line.") + ;;;###autoload (defun modeline-format-major-mode () "The major mode to display in the mode line." (declare (pure t) (side-effect-free t)) - (let ((face (cond ((modeline-active-window-p) 'mode-line-active) - ('mode-line-inactive))) - (mode-string-face - (cond - ((modeline-active-window-p) 'mode-line-active) - ('mode-line-inactive)))) + (let ((face (cond ((modeline-active-window-p) + 'durand-major-global-mode) + ('mode-line-inactive)))) (concat (modeline-propertize (format-mode-line '("%m") face) nil - "Major mode\nmouse-1: Display major mode menu\nmouse-2: Show help for major mode\nmouse-3: Toggle minor modes" + "Major mode\nmouse-1: Display major mode menu\nmouse-2:\ + Show help for major mode\nmouse-3: Toggle minor modes" mode-line-major-mode-keymap) (modeline-spc) (modeline-propertize - (format-mode-line global-mode-string mode-string-face)) + (format-mode-line global-mode-string face)) (modeline-spc)))) ;;;; VCS -- cgit v1.2.3-18-g5258