change color of Minibuffer

61 views
Skip to first unread message

Joon Ro

unread,
Sep 18, 2012, 8:50:51 PM9/18/12
to leo-e...@googlegroups.com
Hi,


But it seems there is no way to change the foreground color of the minibuffer. I'm using solarized dark theme and it would be great if I could change the foreground color as well. Also, I tried many things but it seems I cannot change log window's foreground color, either.

Best,
Joon

Edward K. Ream

unread,
Sep 26, 2012, 8:49:18 AM9/26/12
to leo-e...@googlegroups.com
My apologies for the delay in responding. I'll look into this and add
these capabilities if they don't already exist.

Edward

Edward K. Ream

unread,
Sep 26, 2012, 10:07:39 AM9/26/12
to leo-e...@googlegroups.com
On Wed, Sep 26, 2012 at 7:49 AM, Edward K. Ream <edre...@gmail.com> wrote:

> My apologies for the delay in responding. I'll look into this and add
> these capabilities if they don't already exist.

Rev 5460 Adds support for the @color minibuffer-foreground-color
setting. Please let me know how this works for you.

Edward

Joon Ro

unread,
Sep 27, 2012, 12:58:28 PM9/27/12
to leo-e...@googlegroups.com
Thanks! I will try this and let you know.

Best,
Joon

Joon Ro

unread,
Sep 27, 2012, 1:37:38 PM9/27/12
to leo-e...@googlegroups.com
It works perfect. Thank you very much!

Also, may I ask you of the log pane color as well? I can change background of the log pane in @data qt-gui-plugin-style-sheet, but 
I haven't been able to change the front color. 

I tried @color log_pane_foreground_color and @color log_text_foreground_color, and also tried to add option color: #657b83; in QTextEdit stylesheet.
Best,
Joon

Terry Brown

unread,
Sep 27, 2012, 1:43:03 PM9/27/12
to leo-e...@googlegroups.com
On Thu, 27 Sep 2012 10:37:38 -0700 (PDT)
Joon Ro <joon...@gmail.com> wrote:

> Also, may I ask you of the log pane color as well? I can change background
> of the log pane in @data qt-gui-plugin-style-sheet, but
> I haven't been able to change the front color.
>
> I tried @color log_pane_foreground_color and @color
> log_text_foreground_color, and also tried to add option color: #657b83; in
> QTextEdit stylesheet.

I think all the commands which right text to the log explicitly set the
color as the do so, which is why you can't override it. I guess they
could use a default color specified in a @setting instead of black, but
they also use other explicit colors like red, rather than role based
color selection from a pallette.

Cheers -Terry

Edward K. Ream

unread,
Sep 28, 2012, 9:20:05 AM9/28/12
to leo-e...@googlegroups.com
On Thu, Sep 27, 2012 at 12:43 PM, Terry Brown <terry_...@yahoo.com> wrote:

> I think all the commands which write text to the log explicitly set the
> color as the do so, which is why you can't override it.

Correct.

Leo should use the following setting more often:

@color log_error_color = red.

Also, there is a disabled setting:

@@color log_text_foreground_color = None

I look into this today as I complete the border-color work.

Edward

Edward K. Ream

unread,
Sep 28, 2012, 12:08:00 PM9/28/12
to leo-e...@googlegroups.com
Rev 5461 is a mass update to most of Leo's files, including all
plugins in leoPlugins.leo, that begins this process. Here is the
checkin log:

"A mass update, replacing g.es/_print(color='red') with g.error or
g.red and replacing g.es/_print(color='blue') with g.warning or
g.blue. All unit tests pass and pylint is happy."

A few notes:

- These changes were long overdue anyway. It's bad style to put hard
constants in code, and "red" and "blue" are the worst kinds of hard
constants: they make it difficult or impossible to adapt to different
color schemes, and are not friendly to assistive technologies.

- g.red is a synonym for g.error; and g.blue is a synonym for
g.warning. For instance, you would say g.blue('done') rather than
g.warning('done').

- At present, g.red and g.error always print in red, and g.blue and
g.warning always print in blue, but the point of the mass update is
that these methods can now honor the following settings::

@color log_error_color = red
@color log_warning_color = blue

These is a small problem that must be worked around: these functions
in leoGlobals do not take a 'c' argument, so have no direct way of
doing, say,

color = c.config.getColor('log_error_color') or 'red'

So a kludge will be needed. When the log changes, Leo will set some
global, say g.app.log_c. This is also something that should have been
done a long time ago. I'll be working on this asap.

To summarize, when the work is complete users will be able to set
colors for the log_error_color and log_warning_color settings that
will be compatible with the color scheme used in the log pane. Calls
to g.error and g.red will use the former setting; calls to g.warning
and g.blue will use the latter.

Edward

Edward K. Ream

unread,
Sep 28, 2012, 4:04:16 PM9/28/12
to leo-e...@googlegroups.com
On Friday, September 28, 2012 11:08:01 AM UTC-5, Edward K. Ream wrote:

To summarize, when the work is complete users will be able to set
colors for the log_error_color and log_warning_color settings that
will be compatible with the color scheme used in the log pane.  Calls
to g.error and g.red will use the former setting; calls to g.warning
and g.blue will use the latter.

Done at the trunk at rev 5463.  The work was easier than expected.  g.app.log.c is the desired commander.

g.es now "redirects" colors using the following settings:

    'black':    @color log_text_foreground_color
    'blue':     @color log_warning_color
    'red':      @color log_error_color

In other words, if you specify the colors black, blue or red directly to g.es, or use g.red, g.blue, g.error or g.warning, the actual color used will be based on the settings.

If you specify any other color besides black, blue or red, that will be the actual color of the text sent to the log.  Admittedly, this is a bit kludgy, but it should suffice for almost any conceivable purpose.  Note that using the default settings will result in no color translation at all, which means that g.es(s, color=whatever) will always work as expected.

Edward

Joon Ro

unread,
Sep 28, 2012, 10:14:57 PM9/28/12
to leo-e...@googlegroups.com
I just tried this and finally I have consistent color across all panes of leo. Thanks much! I will let you know if I find something strange.

-Joon

Edward K. Ream

unread,
Sep 29, 2012, 4:53:38 AM9/29/12
to leo-e...@googlegroups.com
On Fri, Sep 28, 2012 at 3:04 PM, Edward K. Ream <edre...@gmail.com> wrote:

> g.es now "redirects" colors
[snip]
> In other words, if you specify the colors black, blue or red directly to
> g.es, or use g.red, g.blue, g.error or g.warning, the actual color used will be based on the settings.

This was a bad idea. Rev 5466 works as follows. g.red, g.note,
g.blue, g.error and g.warning pass the redirected color to g.es. Any
color passed directly to g.es will be honored without redirection.
Giving no color to g.es, or passing color=None, will use the
redirected black color.

Edward
Reply all
Reply to author
Forward
0 new messages