Colors on Windows

16 views
Skip to first unread message

Tiwo W.

unread,
Jul 12, 2024, 6:00:34 AM (10 days ago) Jul 12
to leo-editor
Hi 🦁,

I've managed to install Leo in Windows, in a new Miniconda environment.

The first thing I see is an outright unsuable color scheme - screenshot below. And when I click through the menus in search of themes, after selecting one, this happens: An new Leo window starts, and then both freeze.

leo-colors.png
There are no relevant errors on the console while running, only warnings that sound harmless:
Warning: viewrendered.py running without docutils.
load_session Ignoring invalid session unl: 'unl:gnx://C:/Users/tiwo/.leo/workbook.leo#tiwo.20240712070331.1'
Leo 6.8.0
Python 3.12.4, PyQt version 6.7.2
Windows 11 AMD64 (build 10.0.22631) SP0
Warning: viewrendered.py running without docutils.

After "killing" Leo (in Windows' "the program doesn't respond. Wait/Close" dialogue) this is the Traceback:

Uncaught exception in Leo...
Traceback (most recent call last):
  File "C:\Users\tiwo\miniconda3\envs\leo\Lib\site-packages\leo\plugins\qt_frame.py", line 4241, in onAboutToShow
    self.leo_enable_menu_item(action, commandName)
  File "C:\Users\tiwo\miniconda3\envs\leo\Lib\site-packages\leo\plugins\qt_frame.py", line 4247, in leo_enable_menu_item
    val = func()
          ^^^^^^
  File "C:\Users\tiwo\miniconda3\envs\leo\Lib\site-packages\leo\core\leoCommands.py", line 4168, in canPasteOutline
    s = g.app.gui.getTextFromClipboard()
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\tiwo\miniconda3\envs\leo\Lib\site-packages\leo\plugins\qt_gui.py", line 196, in getTextFromClipboard
    return cb.text()
           ^^^^^^^^^
KeyboardInterrupt

Thomas Passin

unread,
Jul 12, 2024, 9:06:29 AM (10 days ago) Jul 12
to leo-editor
When you open a theme outline using the menu item Settings/Open A Theme File, the original Leo window will be unresponsive until you close the second Leo window, the one that opened the theme outline.  There is nothing wrong; Leo has been this way forever.  It's similar to a modal dialog box, where the parent window is unresponsive until the dialog box is closed.

As to those themes. The second one you tried is a very old one that someone contributed, possibly as an experiment.  There are several others like that, too.  I suggest you try some of the themes I devised.  They all have the string "tbp" in their names.  The ones I suggest trying are:

tbp_dark
tbp_light.leo
minimal-ui-tbp_dark_solarized
minimal-ui-tbp_light_quasi-solarized
minimal-ui-tbp_light_solarized

You can specify which theme Leo should use with the setting @string theme-name = <theme-name>. You should add it to your myLeoSettings.leo  file if it's not already there. You can override the setting by using the --theme=<theme-name> option on the command line when you start Leo.

You may find that one or another of the fonts is the wrong size for your liking.  You can change them by editing the theme's outline, the one you opened in the second window. Look for a node named Fonts & text sizes. There will be nodes with headlines like @string font-size-text = 10.5pt, which controls the font used by the text editors. Change the point size to one you like better.  The node with the headline like @string font-size-ui = 9.5pt controls the font for the "ui" elements, meaning the tree, menus, and so on; basically everything but the text editors.

You should save the edited theme to your .leo\themes directory. Most likely this doesn't exist yet so create it inside the .leo directory. Leo will find it there.  If you save the edited file back to its original location then a later upgrade to leo will overwrite your changes.

If you cruise through the theme's settings you will see plenty of other things that can be changed.  The pattern is that various quantities are given logical names, like font-family. These logical names are assigned values, and the logical names are used in the overall CSS stylesheet instead of the actual values.  The top-level node for the stylesheet is named @data qt-gui-plugin-style-sheet.

Just realize that it's hard to change colors effectively because there are many different colors that need to be coordinated, so just changing one or two may produce poor results (I won't say my own themes are immune to this).
Reply all
Reply to author
Forward
0 new messages