help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

CVS Emacs - changing colour of mode-line image in active window


From: Glenn Morris
Subject: CVS Emacs - changing colour of mode-line image in active window
Date: Sun, 30 Mar 2003 22:38:07 +0100
User-agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/directory/emacs.html)

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!


reply via email to

[Prev in Thread] Current Thread [Next in Thread]