mirror of
https://github.com/correl/doom-modeline.git
synced 2024-11-23 19:19:50 +00:00
Update the icons of file state.
This commit is contained in:
parent
467ad0ca11
commit
a7229a1e40
1 changed files with 12 additions and 12 deletions
|
@ -766,8 +766,8 @@ Uses `all-the-icons-material' to fetch the icon."
|
||||||
(doom-modeline-icon-material
|
(doom-modeline-icon-material
|
||||||
icon
|
icon
|
||||||
:face (if (doom-modeline--active) face)
|
:face (if (doom-modeline--active) face)
|
||||||
:height (or height 1.0)
|
:height (or height 1.1)
|
||||||
:v-adjust (or voffset -0.215))))
|
:v-adjust (or voffset -0.225))))
|
||||||
|
|
||||||
(defvar-local doom-modeline--buffer-file-state-icon nil)
|
(defvar-local doom-modeline--buffer-file-state-icon nil)
|
||||||
(defun doom-modeline-update-buffer-file-state-icon (&rest _)
|
(defun doom-modeline-update-buffer-file-state-icon (&rest _)
|
||||||
|
@ -776,24 +776,24 @@ Uses `all-the-icons-material' to fetch the icon."
|
||||||
(cond (buffer-read-only
|
(cond (buffer-read-only
|
||||||
(doom-modeline-buffer-file-state-icon
|
(doom-modeline-buffer-file-state-icon
|
||||||
"lock"
|
"lock"
|
||||||
'doom-modeline-warning))
|
'doom-modeline-warning
|
||||||
|
1.0
|
||||||
|
-0.215))
|
||||||
((buffer-modified-p)
|
((buffer-modified-p)
|
||||||
(doom-modeline-buffer-file-state-icon
|
(doom-modeline-buffer-file-state-icon
|
||||||
"save"
|
"save"
|
||||||
'doom-modeline-buffer-modified
|
'doom-modeline-buffer-modified))
|
||||||
1.05
|
|
||||||
-0.22))
|
|
||||||
((and buffer-file-name
|
((and buffer-file-name
|
||||||
(not (file-exists-p buffer-file-name)))
|
(not (file-exists-p buffer-file-name)))
|
||||||
(doom-modeline-buffer-file-state-icon
|
(doom-modeline-buffer-file-state-icon
|
||||||
"do_not_disturb_alt"
|
"do_not_disturb_alt"
|
||||||
'doom-modeline-urgent))
|
'doom-modeline-urgent
|
||||||
|
1.0
|
||||||
|
-0.215))
|
||||||
((buffer-narrowed-p)
|
((buffer-narrowed-p)
|
||||||
(doom-modeline-buffer-file-state-icon
|
(doom-modeline-buffer-file-state-icon
|
||||||
"unfold_less"
|
"vertical_align_center"
|
||||||
'doom-modeline-warning
|
'doom-modeline-warning)))))
|
||||||
1.1
|
|
||||||
-0.225)))))
|
|
||||||
(add-hook 'find-file-hook 'doom-modeline-update-buffer-file-state-icon)
|
(add-hook 'find-file-hook 'doom-modeline-update-buffer-file-state-icon)
|
||||||
(add-hook 'after-save-hook 'doom-modeline-update-buffer-file-state-icon)
|
(add-hook 'after-save-hook 'doom-modeline-update-buffer-file-state-icon)
|
||||||
(add-hook 'after-revert-hook 'doom-modeline-update-buffer-file-state-icon)
|
(add-hook 'after-revert-hook 'doom-modeline-update-buffer-file-state-icon)
|
||||||
|
@ -1028,7 +1028,7 @@ Uses `all-the-icons-material' to fetch the icon."
|
||||||
(concat " "
|
(concat " "
|
||||||
(when icon
|
(when icon
|
||||||
(concat
|
(concat
|
||||||
(doom-modeline-icon-material icon :face face :height 1.1 :v-adjust (or voffset -0.2))
|
(doom-modeline-icon-material icon :face face :height 1.1 :v-adjust (or voffset -0.225))
|
||||||
(if text doom-modeline-vspc)))
|
(if text doom-modeline-vspc)))
|
||||||
(if text (propertize text 'face face))
|
(if text (propertize text 'face face))
|
||||||
" "))
|
" "))
|
||||||
|
|
Loading…
Reference in a new issue