* 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
* Re: CVS Emacs - changing colour of mode-line image in active window
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
0 siblings, 1 reply; 5+ messages in thread
From: Stefan Monnier @ 2003-03-31 16:20 UTC (permalink / raw)
> 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.
You can probably do it easily with a XBM image, as for XPM...
Stefan
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: CVS Emacs - changing colour of mode-line image in active window
2003-03-31 16:20 ` Stefan Monnier
@ 2003-03-31 17:23 ` Glenn Morris
2003-03-31 18:16 ` Stefan Monnier
0 siblings, 1 reply; 5+ messages in thread
From: Glenn Morris @ 2003-03-31 17:23 UTC (permalink / raw)
"Stefan Monnier" wrote:
> You can probably do it easily with a XBM image, as for XPM...
Thanks Stefan, but I'm afraid I still don't see it.
Obviously converting to XBM from XPM wouldn't be a problem. In fact,
that's what I started with. I only changed to XPM because I saw that's
what Gnus did for the Gnu-head in the Group buffer mode-line. This has
a constant foreground colour and transparent background, so the
background at least is always the "right" colour.
How would I do it with an XBM? Just using one sans any colours specs,
it Does the Right Thing for the selected window, but has the same
colour in all the non-selected windows, which looks a lot worse than
the transparent XPM. Should I Set the :foreground and :background to
depend on whether the window is selected or not? When I tried this, I
could figure out how to determine the selected window. Also, it seems
that only ever one value is "active" at a time, applying to all
windows.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: CVS Emacs - changing colour of mode-line image in active window
2003-03-31 17:23 ` Glenn Morris
@ 2003-03-31 18:16 ` Stefan Monnier
2003-03-31 18:48 ` Glenn Morris
0 siblings, 1 reply; 5+ messages in thread
From: Stefan Monnier @ 2003-03-31 18:16 UTC (permalink / raw)
>>>>> "GM" == Glenn Morris <gmorris+news@ast.cam.ac.uk> writes:
> How would I do it with an XBM? Just using one sans any colours specs,
> it Does the Right Thing for the selected window, but has the same
> colour in all the non-selected windows, which looks a lot worse than
> the transparent XPM.
Looks like a bug. Please report it with M-x report-emacs-bug.
Stefan
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: CVS Emacs - changing colour of mode-line image in active window
2003-03-31 18:16 ` Stefan Monnier
@ 2003-03-31 18:48 ` Glenn Morris
0 siblings, 0 replies; 5+ messages in thread
From: Glenn Morris @ 2003-03-31 18:48 UTC (permalink / raw)
"Stefan Monnier" wrote:
> Looks like a bug. Please report it with M-x report-emacs-bug.
Okay. I didn't realize Emacs should just Do The Right Thing.
^ 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
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).