Leo has a new default look

93 views
Skip to first unread message

Edward K. Ream

unread,
Oct 11, 2020, 7:15:48 AM10/11/20
to leo-editor
This is part of #1663. I may "refactor" that issue into separate pieces.

The new code is in devel. You can test it by temporarily removing your myLeoSettings.leo.

The new code enables DefaultTheme.leo by default, and makes DefaultTheme a dark theme:

- leoSettings.leo now contains @string theme-name = DefaultTheme
- DefaultTheme.leo is the same as EKRDark.leo, except for a smaller font size.

Imo, the new default look is significantly better than the old "light" look.

Remaining questions

What should the default fonts be? At present, the default font is DejaVu Sans Mono, which may be problematic on some platforms.

DefaultTheme.leo contains a top-level clone for the "Fonts & text sizes" organizer node, so it is easy to see these settings, but newbies probably won't know that.

Your comments please, Amigos.

Edward

Thomas Passin

unread,
Oct 11, 2020, 12:46:19 PM10/11/20
to leo-e...@googlegroups.com
My problem with this is not individual settings like font size, but that I don't know how to modify them.  I tried copying specific settings to myLeoSettings.leo under a new node @theme Default, but they don't take effect.  When I open myLeoSettings.leo, then I seem to get some kind of strange hybrid between my old settings and the new theme.  This isn't really workable for me.

Also, when I use the menu item Settings/Edit A Theme File, the theme file opens in a new modal Leo window and the original Leo window is inactive.  So I wouldn't be able to copy and paste any settings but only to modify the existing theme.

I don't want to modify the default theme file or my changes would be lost every time I use a new version of Leo.

I really wish you had made this change in its own branch and not in devel.  Now I have to fight the new theme while fixing up something strange that has crept into VR3.

[LATER] I disabled the new default theme by adding a setting in myLeoSettings.leo for a non-existent theme:

@string theme-name = xxDefaultTheme

So for now I can do other work, and after that get back to working with the theme.  Good!

Thomas Passin

unread,
Oct 11, 2020, 2:14:30 PM10/11/20
to leo-editor
It seems to me that the .leo directory would be a good place to put modified theme outlines. There could be a .leo/themes subdirectory.

Edward K. Ream

unread,
Oct 11, 2020, 3:01:56 PM10/11/20
to leo-editor
On Sunday, October 11, 2020 at 1:14:30 PM UTC-5, Thomas Passin wrote:

> It seems to me that the .leo directory would be a good place to put modified theme outlines. There could be a .leo/themes subdirectory.

Leo already does this.  See LM.resolve_theme_path and ​LM.computeThemeDirectories:

def computeThemeDirectories(self):
   
"""
    Return a list of *existing* directories that might contain theme .leo files.
    """

    join
= g.os_path_finalize_join
    home
= g.app.homeDir
    leo
= join(g.app.loadDir, '..')
    table
= [
        home
,
        join
(home, 'themes'),
        join
(home, '.leo'),
        join
(home, '.leo', 'themes'),
        join
(leo, 'themes'),
   
]
   
return [g.os_path_normslashes(z) for z in table if g.os_path_exists(z)]
       
# Make sure home has normalized slashes.

Try putting your theme file in your ~/.leo/themes directory.  Does it work for you?

Edward

Thomas Passin

unread,
Oct 11, 2020, 3:12:32 PM10/11/20
to leo-editor
Since I posted, I found that bit in the LeoPyRef.leo file, made a themes subdirectory in .leo, and tried it out.  It did work.  I had a bit of uncertainty about what name to use for the theme specification in myLeoSettings.leo.  Ultimately I used the filename of my copy of the theme file (without the .leo extension) and that worked.  I also tried it on the command line using --theme= and that worked too.

Three cheers for the Nav pane, because it made the searching so easy!  Now we just need to make it easier to modify themes for everyone else.

Edward K. Ream

unread,
Oct 11, 2020, 3:19:01 PM10/11/20
to leo-editor
On Sun, Oct 11, 2020 at 2:12 PM Thomas Passin <tbp1...@gmail.com> wrote:
Since I posted, I found that bit in the LeoPyRef.leo file, made a themes subdirectory in .leo, and tried it out.  It did work.  I had a bit of uncertainty about what name to use for the theme specification in myLeoSettings.leo.  Ultimately I used the filename of my copy of the theme file (without the .leo extension) and that worked.  I also tried it on the command line using --theme= and that worked too.

Thanks for the confirmation.

Edward

Rob

unread,
Oct 12, 2020, 9:32:03 AM10/12/20
to leo-editor
Not sure if this is related, but after pulling the latest updates, my custom theme doesn't work and I now have a dark theme with black text on black background, so Leo is completely unusable. I also get this is the console:

resolve_urls None ==> NOT FOUND
resolve_urls Search paths...
[
'D:/Synced/github repos/leo/leo/themes',
'D:/Synced/github repos/leo/leo/Icons',
'C:/Users/rob_iawac46',
'C:/Users/rob_iawac46/.leo'
]
resolve_urls None ==> NOT FOUND

All 4 paths are valid, so I don't know what the message means.

Any suggestions to revert so I can get back to work?

Rob...

Edward K. Ream

unread,
Oct 12, 2020, 9:59:38 AM10/12/20
to leo-editor
On Mon, Oct 12, 2020 at 8:32 AM Rob <lar...@gmail.com> wrote:
Not sure if this is related, but after pulling the latest updates, my custom theme doesn't work and I now have a dark theme with black text on black background, so Leo is completely unusable. I also get this is the console:

resolve_urls None ==> NOT FOUND
resolve_urls Search paths...
[
'D:/Synced/github repos/leo/leo/themes',
'D:/Synced/github repos/leo/leo/Icons',
'C:/Users/rob_iawac46',
'C:/Users/rob_iawac46/.leo'
]
resolve_urls None ==> NOT FOUND

All 4 paths are valid, so I don't know what the message means.

I'll look into this immediately.

Any suggestions to revert so I can get back to work?

Sure. Check out a previous version with git.

Edward

Rob

unread,
Oct 12, 2020, 10:44:15 AM10/12/20
to leo-editor
OK, I checked out build 1c8cfc5369 from a few days ago and I'm back to my custom theme again, so thanks for that.

Rob...

Edward K. Ream

unread,
Oct 12, 2020, 10:48:48 AM10/12/20
to leo-editor
On Mon, Oct 12, 2020 at 8:32 AM Rob <lar...@gmail.com> wrote:

resolve_urls None ==> NOT FOUND

This message is probably not relevant.

What do you have in your myLeoSettings.leo for @string theme-name ?

Setting it to None should restore the legacy operation.

Edward

Rob

unread,
Oct 12, 2020, 11:00:10 AM10/12/20
to leo-editor
On Monday, October 12, 2020 at 10:48:48 AM UTC-4 Edward K. Ream wrote:

resolve_urls None ==> NOT FOUND

This message is probably not relevant.

Perhaps not, but I don't get the message now after reverting. 

What do you have in your myLeoSettings.leo for @string theme-name ?

Setting it to None should restore the legacy operation.

I actually disabled themes 2 years ago (the theme setting is under an @ignore node now). I manage the appearance now using Qt GUI settings (@color, @font, etc.)

Thomas Passin

unread,
Oct 12, 2020, 11:00:34 AM10/12/20
to leo-editor
Or to anything else that doesn't exist, as I found out yesterday.

Edward K. Ream

unread,
Oct 12, 2020, 11:38:18 AM10/12/20
to leo-editor
On Mon, Oct 12, 2020 at 10:00 AM Rob <lar...@gmail.com> wrote:

> I actually disabled themes 2 years ago (the theme setting is under an @ignore node now). I manage the appearance now using Qt GUI settings (@color, @font, etc.)

In that case, you should definitely set @string theme-name = None in your myLeoSettings.leo.

Let me know if that doesn't work for you.

Edward
Reply all
Reply to author
Forward
0 new messages