Improve icons for the persp-name segment.

This commit is contained in:
Vincent Zhang 2019-07-02 13:52:00 +08:00
parent 24fd535a69
commit fd52978a97
3 changed files with 26 additions and 19 deletions

View file

@ -101,6 +101,9 @@ It returns a file name which can be used directly as argument of
("pause" . "\xe034") ("pause" . "\xe034")
("priority_high" . "\xe645") ("priority_high" . "\xe645")
;; Persp
("aspect_ratio" . "\xe85b")
;; LSP ;; LSP
("rocket" . "\xf135") ("rocket" . "\xf135")

View file

@ -1332,17 +1332,21 @@ Requires `eyebrowse-mode' to be enabled."
(let* ((persp (get-current-persp)) (let* ((persp (get-current-persp))
(name (safe-persp-name persp)) (name (safe-persp-name persp))
(icon (if (and doom-modeline-icon doom-modeline-persp-name-icon) (icon (if (and doom-modeline-icon doom-modeline-persp-name-icon)
(concat (doom-modeline-icon-material "aspect_ratio" :v-adjust -0.17) (doom-modeline-spc)) (doom-modeline-icon-material "aspect_ratio" :v-adjust -0.225)
"#"))) "#"))
(face (if (and persp
(not (persp-contain-buffer-p (current-buffer) persp)))
'doom-modeline-persp-buffer-not-in-persp
'doom-modeline-persp-name)))
(unless (string-equal persp-nil-name name) (unless (string-equal persp-nil-name name)
(concat (concat
(doom-modeline-spc) (doom-modeline-spc)
(propertize (propertize icon
(format "%s%s" icon name) 'face `(:inherit ,(get-text-property 0 'face icon)
'face (if (and persp :inherit ,face))
(not (persp-contain-buffer-p (current-buffer) persp))) (doom-modeline-vspc)
'doom-modeline-persp-buffer-not-in-persp (propertize name
'doom-modeline-persp-name) 'face face
'help-echo "mouse-1: Switch perspective 'help-echo "mouse-1: Switch perspective
mouse-2: Show help for minor mode" mouse-2: Show help for minor mode"
'mouse-face 'mode-line-highlight 'mouse-face 'mode-line-highlight

View file

@ -4,7 +4,7 @@
;; Author: Vincent Zhang <seagle0128@gmail.com> ;; Author: Vincent Zhang <seagle0128@gmail.com>
;; Homepage: https://github.com/seagle0128/doom-modeline ;; Homepage: https://github.com/seagle0128/doom-modeline
;; Version: 2.3.6 ;; Version: 2.3.7
;; Package-Requires: ((emacs "25.1") (all-the-icons "1.0.0") (shrink-path "0.2.0") (dash "2.11.0")) ;; Package-Requires: ((emacs "25.1") (all-the-icons "1.0.0") (shrink-path "0.2.0") (dash "2.11.0"))
;; Keywords: faces mode-line ;; Keywords: faces mode-line