mirror of
https://github.com/correl/doom-modeline.git
synced 2024-11-23 19:19:50 +00:00
Improve icons for the persp-name segment.
This commit is contained in:
parent
24fd535a69
commit
fd52978a97
3 changed files with 26 additions and 19 deletions
|
@ -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")
|
||||||
|
|
||||||
|
|
|
@ -1332,28 +1332,32 @@ 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
|
||||||
'local-map (let ((map (make-sparse-keymap)))
|
'local-map (let ((map (make-sparse-keymap)))
|
||||||
(define-key map [mode-line mouse-1]
|
(define-key map [mode-line mouse-1]
|
||||||
#'persp-switch)
|
#'persp-switch)
|
||||||
(define-key map [mode-line mouse-2]
|
(define-key map [mode-line mouse-2]
|
||||||
(lambda ()
|
(lambda ()
|
||||||
(interactive)
|
(interactive)
|
||||||
(describe-function 'persp-mode)))
|
(describe-function 'persp-mode)))
|
||||||
map))
|
map))
|
||||||
(doom-modeline-spc)))))))
|
(doom-modeline-spc)))))))
|
||||||
|
|
||||||
(add-hook 'find-file-hook #'doom-modeline-update-persp-name)
|
(add-hook 'find-file-hook #'doom-modeline-update-persp-name)
|
||||||
|
|
|
@ -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
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue