all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* CVS Emacs - changing colour of mode-line image in active window
@ 2003-03-30 21:38 Glenn Morris
  2003-03-31 16:20 ` Stefan Monnier
  0 siblings, 1 reply; 5+ messages in thread
From: Glenn Morris @ 2003-03-30 21:38 UTC (permalink / raw)



This is a question relating to the CVS version of Emacs, 21.3.50. I
hope nobody minds me asking here, but it's not the kind of thing the
devel list should be bothered with, IMO.

With mode-line-in-non-selected-windows non-nil, the mode-line has a
different colour in non-active windows.

If I do

(display-time-mode 1)

and

(setq display-time-string-forms '("foo"))

then the resulting mode-line string "foo" also changes colour to
match the rest of the mode-line according to whether the window is
active or not.

I would like to achieve the same effect, but with an image.
Specifically, I want to put an XPM image in the mode-line, with a
transparent background (so that part of the image always has the
"correct" colour"), and a foreground colour that adjusts to match that
of the mode-line.

In detail, I'm using this kind of thing:

(setq display-time-string-forms
      `((propertize "*"
                    'display
                    '(image :type xpm
                            :file "/home/gmorris/.emacs.d/images/clock.xpm"
                            :ascent center
                            :color-symbols 
                            ,(list (cons "FG" (face-attribute
                                              'mode-line :foreground))))
                    'help-echo (format-time-string "%H:%M, %A %B %e %Y"))))

to get a pop-up clock in the mode-line. clock.xpm has a transparent
background, and a foreground colour with symbolic name "FG". What I
want is to translate "FG" to the mode-line foreground in the active
window, and to mode-line-inactive foreground in other windows.

Is this possible within the confines of display-time-string-forms? My
current impression is that it is not, in which case is there any
other way to achieve the desired result?

This is not at all important, because it won't kill me to live with a
clock that is always blue (say), I've just become curious about the
answer. :)

Thanks in advance!

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2003-03-31 18:48 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-03-30 21:38 CVS Emacs - changing colour of mode-line image in active window Glenn Morris
2003-03-31 16:20 ` Stefan Monnier
2003-03-31 17:23   ` Glenn Morris
2003-03-31 18:16     ` Stefan Monnier
2003-03-31 18:48       ` Glenn Morris

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.