From d103243e2a328b2a495a5327aba49d9ac3b34521 Mon Sep 17 00:00:00 2001 From: Vincent Zhang Date: Mon, 29 Apr 2019 11:34:06 +0800 Subject: [PATCH] Adjust the position of the last icon. The widths of battery icons > 2 characters. --- doom-modeline-core.el | 4 ++-- doom-modeline-segments.el | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/doom-modeline-core.el b/doom-modeline-core.el index e625277..ea9b40e 100644 --- a/doom-modeline-core.el +++ b/doom-modeline-core.el @@ -81,10 +81,10 @@ It returns a file name which can be used directly as argument of ;; TODO: better performance? (doom-moddeline--set-font-widths all-the-icons-data/alltheicons-alist) ;; (doom-moddeline--set-font-widths all-the-icons-data/file-icon-alist) -(doom-moddeline--set-font-widths all-the-icons-data/fa-icon-alist) -(doom-moddeline--set-font-widths all-the-icons-data/octicons-alist) ;; (doom-moddeline--set-font-widths all-the-icons-data/weather-icons-alist) +(doom-moddeline--set-font-widths all-the-icons-data/octicons-alist) (doom-moddeline--set-font-widths all-the-icons-data/material-icons-alist) +(doom-moddeline--set-font-widths all-the-icons-data/fa-icon-alist) ;; diff --git a/doom-modeline-segments.el b/doom-modeline-segments.el index 4d0e277..67db3ac 100644 --- a/doom-modeline-segments.el +++ b/doom-modeline-segments.el @@ -922,7 +922,10 @@ icons." :inherit mode-line-inactive))) (when (and doom-modeline-icon icon text) doom-modeline-inactive-vspc) - (when text (propertize text 'face 'mode-line-inactive)))))) + (when text (propertize text 'face 'mode-line-inactive)))) + ;; Adjust the position of the last icon + (if (and (display-graphic-p) (bound-and-true-p fancy-battery-mode)) + (propertize " " 'face (if active 'mode-line 'mode-line-inactive))))) "")))