-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve color handling #4
base: master
Are you sure you want to change the base?
Changes from 1 commit
2c2e279
9914b11
d8e6d29
f355f02
9398b5d
531921a
211e0e0
ad88aa8
2452eeb
ffc733a
806aadc
23f2645
1e09dbc
30bbe6f
8e2142d
44d078b
b54a651
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -43,6 +43,11 @@ | |
:group 'svg-battery-indicator | ||
:type 'face) | ||
|
||
(defcustom svg-battery-indicator-fill-face 'mode-line-inactive | ||
"Face used to fill battery image based on percent." | ||
:group 'svg-battery-indicator | ||
:type 'face) | ||
|
||
(defun svg-battery-indicator--battery (base-height base-length nub-width stroke-width rounding-radius) | ||
"Generate a basic battery SVG." | ||
(let ((svg (svg-create (+ nub-width base-length) base-height | ||
|
@@ -89,7 +94,7 @@ CHARGING is non-nil a lightning symbol is drawn over the SVG." | |
'battery-load-critical) | ||
((<= percentage battery-load-low) | ||
'battery-load-low) | ||
(t 'mode-line)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I like this idea, but I'm not sure we need to use face. I used faces for the other colours because I wanted automatic consistency with the standard battery colours, and those are setup as faces. But here, there isn't anything obvious to inherit from. Or in other words: from the users point of view, this is isn't the sort that is usually customised by changing a face. Maybe we should just use a colour value string? |
||
(t svg-battery-indicator-fill-face)) | ||
:foreground nil 'inherit))) | ||
;; Fill/percentage rectangle | ||
(let* ((os (* 2 sw)) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we do use a face here, I as a user would expect anything called *-face which controls colouring to be a face, not variable pointing at a symbol for a face. So if we do use a face (which again, I'm not sure we should), it should be something more like: