Add an icon (mail) for mu4e-alert and update faces.

This commit is contained in:
Vincent Zhang 2019-02-28 15:34:57 +07:00
parent 58267460c6
commit 4377c9ea5c

View file

@ -1502,7 +1502,7 @@ Example:
(propertize "#" 'face '(:inherit (doom-modeline-warning doom-modeline-unread-number)))) (propertize "#" 'face '(:inherit (doom-modeline-warning doom-modeline-unread-number))))
doom-modeline-vspc doom-modeline-vspc
(propertize (number-to-string doom-modeline--github-notifications-number) (propertize (number-to-string doom-modeline--github-notifications-number)
'face '(:inherit (warning doom-modeline-unread-number)))) 'face '(:inherit (doom-modeline-warning doom-modeline-unread-number))))
'help-echo "Github Notifications 'help-echo "Github Notifications
mouse-1: Show notifications mouse-1: Show notifications
mouse-3: Fetch notifications" mouse-3: Fetch notifications"
@ -1581,12 +1581,25 @@ mouse-1: Toggle Debug on Quit"
(> mu4e-alert-mode-line 0)) (> mu4e-alert-mode-line 0))
;; remove mu4e-alert's global modeline string setting ;; remove mu4e-alert's global modeline string setting
(setq global-mode-string (delete '(:eval mu4e-alert-mode-line) global-mode-string)) (setq global-mode-string (delete '(:eval mu4e-alert-mode-line) global-mode-string))
(concat
" "
(propertize (propertize
(concat " " (number-to-string mu4e-alert-mode-line) " ") (concat
'face 'doom-modeline-unread-number (if doom-modeline-icon
(doom-modeline-icon-material "mail"
:height 1.1
:v-adjust -0.225
:face 'doom-modeline-warning)
(propertize "#"
'face '(:inherit (doom-modeline-warning doom-modeline-unread-number))))
doom-modeline-vspc
(propertize (number-to-string mu4e-alert-mode-line)
'face '(:inherit (doom-modeline-warning doom-modeline-unread-number))))
'mouse-face 'mode-line
'help-echo (if (= mu4e-alert-mode-line 1) 'help-echo (if (= mu4e-alert-mode-line 1)
"You have an unread email" "You have an unread email"
(format "You have %s unread emails" mu4e-alert-mode-line))))) (format "You have %s unread emails" mu4e-alert-mode-line)))
" ")))
;; ;;
@ -1620,8 +1633,8 @@ we don't want to remove that so we just return the original."
(doom-modeline-def-segment irc-buffers (doom-modeline-def-segment irc-buffers
"The list of shortened, unread irc buffers." "The list of shortened, unread irc buffers."
(when (and doom-modeline-irc (when (and doom-modeline-irc
(boundp 'tracking-mode-line-buffers)
(doom-modeline--active) (doom-modeline--active)
(boundp 'tracking-mode-line-buffers)
(derived-mode-p 'circe-mode)) (derived-mode-p 'circe-mode))
;; add a space at the end to pad against the following segment ;; add a space at the end to pad against the following segment
(concat " " (doom-modeline--tracking-buffers tracking-buffers) " "))) (concat " " (doom-modeline--tracking-buffers tracking-buffers) " ")))
@ -1635,14 +1648,16 @@ we don't want to remove that so we just return the original."
(concat (concat
" " " "
(propertize (if doom-modeline-icon (propertize (if doom-modeline-icon
(doom-modeline-icon-material "sms" (doom-modeline-icon-material "message"
:height 0.9 :height 1.1
:v-adjust -0.225
:face 'doom-modeline-warning) :face 'doom-modeline-warning)
(propertize "IRC" 'face 'doom-modeline-warning)) (propertize "#"
'face '(:inherit (doom-modeline-warning
doom-modeline-unread-number))))
'help-echo (format "IRC Notifications: %s" 'help-echo (format "IRC Notifications: %s"
(doom-modeline--tracking-buffers (doom-modeline--tracking-buffers
tracking-buffers)) tracking-buffers)))
'display '(raise -0.17))
" "))) " ")))
(provide 'doom-modeline-segments) (provide 'doom-modeline-segments)