Improve git notifications segment.

This commit is contained in:
Vincent Zhang 2019-01-24 01:58:17 +08:00
parent 849ba7097f
commit 9ca40d04b1

View file

@ -1429,29 +1429,30 @@ Example:
(if (and doom-modeline-github (if (and doom-modeline-github
(doom-modeline--active) (doom-modeline--active)
(> doom-modeline--github-notifications-number 0)) (> doom-modeline--github-notifications-number 0))
(concat " " (propertize
(if doom-modeline-icon (concat " "
(doom-modeline-icon-faicon "github" (if doom-modeline-icon
:v-adjust -0.0575 (doom-modeline-icon-faicon "github"
:face 'doom-modeline-warning) :v-adjust -0.0575
(propertize "#" 'face '(:inherit (doom-modeline-warning italic)))) :face 'doom-modeline-warning)
doom-modeline-vspc (propertize "#" 'face '(:inherit (doom-modeline-warning italic))))
(propertize (number-to-string doom-modeline--github-notifications-number) doom-modeline-vspc
'face '(:inherit (warning italic)) (propertize (number-to-string doom-modeline--github-notifications-number)
'help-echo "Github Notifications 'face '(:inherit (warning italic)))
" ")
'help-echo "Github Notifications
mouse-1: Show notifications mouse-1: Show notifications
mouse-3: Fetch notifications" mouse-3: Fetch notifications"
'mouse-face 'mode-line-highlight 'mouse-face '(:box 1)
'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]
#'doom-modeline--github-open-notifications) #'doom-modeline--github-open-notifications)
(define-key map [mode-line mouse-3] (define-key map [mode-line mouse-3]
(lambda () (lambda ()
(interactive) (interactive)
(message "Fetching github notifications...") (message "Fetching github notifications...")
(doom-modeline--github-fetch-notifications))) (doom-modeline--github-fetch-notifications)))
map)) map))))
" ")))
;; ;;