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")
|
||||
("priority_high" . "\xe645")
|
||||
|
||||
;; Persp
|
||||
("aspect_ratio" . "\xe85b")
|
||||
|
||||
;; LSP
|
||||
("rocket" . "\xf135")
|
||||
|
||||
|
|
|
@ -1332,28 +1332,32 @@ Requires `eyebrowse-mode' to be enabled."
|
|||
(let* ((persp (get-current-persp))
|
||||
(name (safe-persp-name persp))
|
||||
(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)
|
||||
(concat
|
||||
(doom-modeline-spc)
|
||||
(propertize
|
||||
(format "%s%s" icon name)
|
||||
'face (if (and persp
|
||||
(not (persp-contain-buffer-p (current-buffer) persp)))
|
||||
'doom-modeline-persp-buffer-not-in-persp
|
||||
'doom-modeline-persp-name)
|
||||
'help-echo "mouse-1: Switch perspective
|
||||
(propertize icon
|
||||
'face `(:inherit ,(get-text-property 0 'face icon)
|
||||
:inherit ,face))
|
||||
(doom-modeline-vspc)
|
||||
(propertize name
|
||||
'face face
|
||||
'help-echo "mouse-1: Switch perspective
|
||||
mouse-2: Show help for minor mode"
|
||||
'mouse-face 'mode-line-highlight
|
||||
'local-map (let ((map (make-sparse-keymap)))
|
||||
(define-key map [mode-line mouse-1]
|
||||
#'persp-switch)
|
||||
(define-key map [mode-line mouse-2]
|
||||
(lambda ()
|
||||
(interactive)
|
||||
(describe-function 'persp-mode)))
|
||||
map))
|
||||
'mouse-face 'mode-line-highlight
|
||||
'local-map (let ((map (make-sparse-keymap)))
|
||||
(define-key map [mode-line mouse-1]
|
||||
#'persp-switch)
|
||||
(define-key map [mode-line mouse-2]
|
||||
(lambda ()
|
||||
(interactive)
|
||||
(describe-function 'persp-mode)))
|
||||
map))
|
||||
(doom-modeline-spc)))))))
|
||||
|
||||
(add-hook 'find-file-hook #'doom-modeline-update-persp-name)
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
;; Author: Vincent Zhang <seagle0128@gmail.com>
|
||||
;; 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"))
|
||||
;; Keywords: faces mode-line
|
||||
|
||||
|
|
Loading…
Reference in a new issue