On Tuesday, March 7, 2017 at 4:44:44 PM UTC-6, Terry Brown wrote:
>
> On Tue, 7 Mar 2017 16:13:49 -0600
> "Edward K. Ream" <[email protected]> wrote:
>
> > 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?
>
> I don't see how this is in anyway specific to themes. It's always
> potentially confusing to know which of Leo's @settings takes effect,
> should you have more than one value defined for a particular @setting.
>
In practice, it bites harder for themes, because so many settings must
change and be copied.
Hmm. I have just realized that not all theme settings are merely indirect
ways of setting the stylesheet. There are at least three such settings:
@bool color_theme_is_dark = True
@bool use_focus_border = False
@string color_theme = ekr_dark
So these settings have to copied to the "proper" place, wherever that is ;-)
> Out of the question. We aren't going to change things behind the scenes
> like that.
>
> If I'm remembering correctly, expand_css_constants() processes all the
> substitutions.
Yes.
> Storing it's output in @data qt-plugin-style-sheet would freeze the them
> with the definitions
> present at the time, so the entire theme's represented by a single node,
> which the user could copy in to their settings.
>
I'm good with that, as long as it is done explicitly, say with @button
freeze-stylesheet. It must not be a side effect of executing
expand_css_constants during startup.
> > In practice, the new way will be simpler than the old. Just change the
> @constants node and press make-style-sheet.
>
> The old way already supports exactly that workflow. Just put all your
> constants in a CSS comment.
Ok. You've convinced me that the old way might be good enough. And I do
remember seeing the css comment.
But this just can *not *be an Easter Egg, to be discovered, if at all, only
hours later. Instead, it's got to be obvious how to change these constants.
> I think it's much more Leonine to put all your settings in nodes in a
> subtrees.
>
Well, we don't really have a choice, at least with non-stylesheet settings
like the three settings listed above.
But I don't really think this is a matter of being Leonine or not. If I
myself am utterly confused by the morass of settings, *something* is not
right. I don't care what we call it, it's poor design.
Please don't take any of this personally. It's nobodies fault. Not yours,
not mine. We have just got something that is broken and must be fixed.
I don't really see how adding a third way to define style sheets
> (@constants) simplifies things.
>
Hehe. It's actually going to be the new "one and only way" :-) The
advantages as I see them is that settings that really only affect
stylesheets can be treated in one place, and never need to be copied into
myLeoSettings.leo.
Having said that, I'll review the css comments stuff to see what I can use
of it. Maybe a lot.
*Summary*
Well, this has been, as always, a fruitful discussion. You've given me
lots to think about.
Maybe we can make the css comments do the heavy lifting, as you suggest.
In that case, maybe not much new really is required. But it must be a lot
easier to discover and use than at present.
Here is what I know for sure:
1. No matter what we do, the user will have to copy more than one setting
into myLeoSettings.leo.
2. There is a distinction, brought forth more clearly in this discussion,
between settings that affect the stylesheet and settings that are used by
Leo's core in other ways. These latter settings must be copied to
myLeoSettings.leo.
3. I am going to leave the StyleSheetManager alone, for compatibility with
existing settings.
4. We have got to come up with something that is obvious and explicit. Like
an @button node. No Easter Eggs.
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.