On Tue, Mar 7, 2017 at 3:04 PM, 'Terry Brown' via leo-editor < leo-editor@googlegroups.com> wrote:
> To be honest I don't remember the motivation for supporting parsing values > from comments in CSS. > I don't think it was ever a conscious thing. The present code just does it. > The use of regular @settings nodes seems more Leonine to me. > That would be true if there was a single set of settings. But that's not true when there are multiple themes to choose from. The present (accurate) comment is the following: In order for theme settings to take effect, you may need to disable > existing `@color` and `@data qt-gui-plugin-style-sheet` nodes in > myLeoSettings.leo. Do this by deleting them or moving them out of the > @settings tree. > This is unacceptable. It's terribly confusing for me, and I wrote the settings code. Which setting takes effect? The first one, or the last? Worse, how do we save/restore settings when switching themes? It's a nightmare. I see no way to switch between settings, except by using completely distinct @settings trees (disabling the unwanted ones). But in that case, there is no way, (except by using clones) of sharing common settings. Instead, isolating settings to @constants nodes looks like the simplest thing that could possibly work. I'm not sure I have conveyed how completely unhappy I am with the present scheme. It's pissing me off, and it will surely confuse and terrify newbies. > But that also seems to require iterative substitution. When the system > was working, it supported both. > The present code will remain unchanged. New style sheets will require no further @-substitutions, rendering the present code moot. > Although I disagree with your desire to have static stylesheets(*), I > don't think it would take any changes to the existing code to do that. > Just store the output from expand_css_constants() in @data > qt-plugin-style-sheet, or whatever it's called. > Out of the question. We aren't going to change things behind the scenes like that. (*) because static stylesheets force anyone who wants to tweak a color or > font size in a theme to recompile the whole stylesheet, vs. just changing a > single @setting. > In practice, the new way will be simpler than the old. Just change the @constants node and press make-style-sheet. My offer to take a look at this remains, but I can't do anything while > you're changing things around. Also, based on the git log message > experience, I think it would be really useful to have all these changes > isolated in a branch, so if any rolling back is needed, there are > interspersed unrelated commits to avoid. > Yes. I'll create a themes branch next. I plan no further changes to the StyleSheetManager class in qt_gui.py. It will work exactly as before, for compatibility with existing style sheets (@data nodes). All further work will likely be confined to leoSettings.leo, including the new @button node. I'll probably retire themes.leo and move it to the long-term attic. I'll also eliminate the open-themes-leo command. 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.