Excellent progress yesterday.  Significant work remains.

*Yesterday's work*

1. These two @button nodes now work properly, seemingly in all respects 
(but see below).

@button open-light-theme
c.styleSheetManager.load_theme_file('EKRLight.leo')

@button open-dark-theme
c.styleSheetManager.load_theme_file('LeoBlackSolarized.leo')

All complications are confined to the StyleSheetManager class in qt_gui.py.

2. Chris George and I are collaborating to make it easier to generalize 
both themes and style sheets.  Chris has been dumping icons into 
leo/Icons.  That's fine, but the goal will to move the *new* folders into 
leo/themes.

Perhaps I should have created a themes git branch, but now that would just 
make it more difficult to deal with the new folders.

3. ssm.expand_css_constants now *always* warns (in the console) if a 
stylesheet contains unresolved @ constants.  This was a crucial missing 
tool for devs.  How did stylesheet devs ever live without these warnings?

Style sheets should not have unresolved constants! They create the 
potential for settings defined in leoSettings.leo or myLeoSettings to 
"bleed into" the stylesheet.  The result will be massive confusion for 
stylesheet devs.

The two theme .leo files in leo/themes now contain no unresolved 
@constants.  For the first time, they are fit as models for further testing.

*Further work*

A. The two @button nodes do work, but Ctrl-N, opening a new .leo file gives 
quite a surprise.  The theme reverts to the user's theme in all panes!

Imo, loading a theme must do the following:

1. Remember the loaded theme in a global *list* of all previously-loaded 
themes.
2. Suppress loading myLeoSettings.leo and leoSettings.leo when opening a 
new file.
3. Apply the previously loaded themes (in order) when opening a  new file.

B. We want later themes to be able to *add to* previous themes.  This might 
already "just work" in a limited way: The present code allows themes 
without style sheets.  Such themes alter only global settings, such as 
syntax coloring settings or other text colors.

I'll experiment with support for @data additional-style-sheet.  The body 
would be a style sheet that, as its name implies, would be tacked on to 
whatever stylesheet is *already* in effect.  This would be valid only if 
the theme defines neither @data qt-gui-plugin-stylesheet nor 
qt-gui-user-stylesheet.  Understand?

C. Point A hints at replacing @theme trees in myLeoSettings.leo with a new 
setting, say:

    @string use_theme = <path to theme file>

Don't panic. This setting will be completely optional.  We *must* continue 
to support whatever users have in myLeoSettings.leo.

*Summary*

Loading a theme should suppress further use of *all* settings in 
leoSettings.leo and myLeoSettings.leo. Or so I think now.

Goals:

- Allow themes to partially override previously loaded themes using @data 
additional-style-sheet. 
- Allow themes without stylesheets. These would override colors.
- Apply all previously loaded themes in order when opening a new file.
- Support the *optional* setting @string use_theme, while supporting all 
legacy myLeoSettings.leo files.

Chris George is providing valuable feedback during this process.

Edward

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.

Reply via email to