mirror of
https://git.notmuchmail.org/git/notmuch
synced 2025-01-05 16:21:44 +01:00
emacs: Adapt the logo background colour to that of the frame
The notmuch logo uses transparency. That can display poorly when inserting the image into an emacs buffer (black logo on a black background), so force the background colour of the image. We use a face (`notmuch-hello-logo-background') to represent the colour so that `defface' can be used to declare the different possible colours, which depend on whether the frame has a light or dark background.
This commit is contained in:
parent
42bda003a0
commit
7b31a11f20
1 changed files with 17 additions and 8 deletions
|
@ -55,9 +55,14 @@
|
||||||
:type 'boolean
|
:type 'boolean
|
||||||
:group 'notmuch)
|
:group 'notmuch)
|
||||||
|
|
||||||
(defcustom notmuch-hello-logo-background "#5f5f5f"
|
(defface notmuch-hello-logo-background
|
||||||
|
'((((class color)
|
||||||
|
(background dark))
|
||||||
|
(:background "#5f5f5f"))
|
||||||
|
(((class color)
|
||||||
|
(background light))
|
||||||
|
(:background "white")))
|
||||||
"Background colour for the notmuch logo."
|
"Background colour for the notmuch logo."
|
||||||
:type 'color
|
|
||||||
:group 'notmuch)
|
:group 'notmuch)
|
||||||
|
|
||||||
(defcustom notmuch-hello-jump-to-search t
|
(defcustom notmuch-hello-jump-to-search t
|
||||||
|
@ -209,12 +214,16 @@ diagonal."
|
||||||
|
|
||||||
(when notmuch-hello-show-logo
|
(when notmuch-hello-show-logo
|
||||||
(let ((image notmuch-hello-logo))
|
(let ((image notmuch-hello-logo))
|
||||||
;; dme: Sorry, I don't know any other way to achieve this :-( The
|
;; The notmuch logo uses transparency. That can display poorly
|
||||||
;; notmuch logo uses transparency. That works out badly when
|
;; when inserting the image into an emacs buffer (black logo on
|
||||||
;; inserting the image into an emacs buffer, so force the
|
;; a black background), so force the background colour of the
|
||||||
;; background colour of the image.
|
;; image. We use a face to represent the colour so that
|
||||||
(setq image (cons 'image (append (cdr image)
|
;; `defface' can be used to declare the different possible
|
||||||
`(:background ,notmuch-hello-logo-background))))
|
;; colours, which depend on whether the frame has a light or
|
||||||
|
;; dark background.
|
||||||
|
(setq image (cons 'image
|
||||||
|
(append (cdr image)
|
||||||
|
(list :background (face-background 'notmuch-hello-logo-background)))))
|
||||||
(insert-image image))
|
(insert-image image))
|
||||||
(widget-insert " "))
|
(widget-insert " "))
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue