Make the icon faces inconsistent.

Fix #306.
1. Remove face: doom-modeline-icon-inactive.
2. Change the face as plist.
This commit is contained in:
Vincent Zhang 2020-02-16 23:03:21 +08:00
parent c2b286f2f3
commit 68e17437cf
2 changed files with 18 additions and 22 deletions

View file

@ -463,11 +463,6 @@ It returns a file name which can be used directly as argument of
"The face used for the left-most bar in the mode-line of an inactive window." "The face used for the left-most bar in the mode-line of an inactive window."
:group 'doom-modeline-faces) :group 'doom-modeline-faces)
(defface doom-modeline-icon-inactive
`((t (:foreground ,(face-foreground 'mode-line-inactive))))
"The face used for the icon in the mode-line of an inactive window."
:group 'doom-modeline-faces)
(defface doom-modeline-debug-visual (defface doom-modeline-debug-visual
`((t (:background ,(face-foreground 'all-the-icons-orange)))) `((t (:background ,(face-foreground 'all-the-icons-orange))))
"Face to use for the mode-line while debugging." "Face to use for the mode-line while debugging."
@ -846,7 +841,7 @@ It returns a file name which can be used directly as argument of
;; break them if the font family is set. ;; break them if the font family is set.
;; @see https://github.com/seagle0128/doom-modeline/issues/301 ;; @see https://github.com/seagle0128/doom-modeline/issues/301
(when (eq face 'mode-line-inactive) (when (eq face 'mode-line-inactive)
(plist-put args :face 'doom-modeline-icon-inactive)) (plist-put args :face nil))
(pcase icon-set (pcase icon-set
('octicon ('octicon

View file

@ -359,13 +359,11 @@ mouse-1: Previous buffer\nmouse-3: Next buffer"
(when-let ((icon (or doom-modeline--buffer-file-icon (when-let ((icon (or doom-modeline--buffer-file-icon
(doom-modeline-update-buffer-file-icon)))) (doom-modeline-update-buffer-file-icon))))
(concat (concat
(if (doom-modeline--active) (if (and (doom-modeline--active) doom-modeline-major-mode-color-icon)
(if doom-modeline-major-mode-color-icon icon
icon (propertize icon 'face (plist-put
(propertize icon 'face `(:inherit ,(get-text-property 0 'face icon) (copy-list (get-text-property 0 'face icon))
:foreground ,(face-foreground 'mode-line)))) :inherit nil)))
(propertize icon 'face `(:inherit ,(get-text-property 0 'face icon)
:inherit doom-modeline-icon-inactive)))
(doom-modeline-vspc))))) (doom-modeline-vspc)))))
(defsubst doom-modeline--buffer-state-icon () (defsubst doom-modeline--buffer-state-icon ()
@ -375,8 +373,9 @@ mouse-1: Previous buffer\nmouse-3: Next buffer"
(concat (concat
(if (doom-modeline--active) (if (doom-modeline--active)
icon icon
(propertize icon 'face `(:inherit ,(get-text-property 0 'face icon) (propertize icon 'face (plist-put
:inherit doom-modeline-icon-inactive))) (copy-list (get-text-property 0 'face icon))
:inherit nil)))
(doom-modeline-vspc))))) (doom-modeline-vspc)))))
(defsubst doom-modeline--buffer-name () (defsubst doom-modeline--buffer-name ()
@ -654,9 +653,9 @@ Uses `all-the-icons-octicon' to fetch the icon."
(concat (concat
(if active (if active
icon icon
(propertize icon (propertize icon 'face (plist-put
'face `(:inherit ,(get-text-property 0 'face icon) (copy-list (get-text-property 0 'face icon))
:inherit doom-modeline-icon-inactive))) :inherit nil)))
(doom-modeline-vspc)) (doom-modeline-vspc))
'mouse-face 'mode-line-highlight 'mouse-face 'mode-line-highlight
'help-echo (get-text-property 1 'help-echo vc-mode) 'help-echo (get-text-property 1 'help-echo vc-mode)
@ -995,8 +994,9 @@ mouse-1: List all problems%s"
(when icon (when icon
(if active (if active
icon icon
(propertize icon 'face `(:inherit ,(get-text-property 0 'face icon) (propertize icon 'face (plist-put
:inherit doom-modeline-icon-inactive)))) (copy-list (get-text-property 0 'face icon))
:inherit nil))))
(when text (when text
(concat (concat
(doom-modeline-vspc) (doom-modeline-vspc)
@ -1808,8 +1808,9 @@ mouse-1: Start server"))
(doom-modeline-spc) (doom-modeline-spc)
(if active (if active
icon icon
(propertize icon 'face `(:inherit ,(get-text-property 0 'face icon) (propertize icon 'face (plist-put
:foreground ,(face-foreground 'mode-line-inactive)))) (copy-list (get-text-property 0 'face icon))
:inherit nil)))
(doom-modeline-spc)))))) (doom-modeline-spc))))))
(defun doom-modeline-override-eglot-modeline () (defun doom-modeline-override-eglot-modeline ()