On Wed, Dec 4, 2013 at 10:00 AM, Terry Brown <terry_n_br...@yahoo.com>wrote:
> On Wed, 4 Dec 2013 04:10:03 -0800 (PST) > "Edward K. Ream" <edream...@gmail.com> wrote: > > > > Here, I'll summarize the pros and cons of style sheets, and throw out an > > alternative for discussion. > > So, that's not really an alternative :-), it's what we're getting > close to having with the latest code. > That's excellent. > > Current trunk works like this: > > Ordinary Leo @settings, specifically @color and @string > are used to specify colors, font names, font sizes, etc. > As I think about this, it seems to me that leoSettings.leo should be reorganized. Most importantly, all settings that affect visuals should appear in a "Visuals" tree. > > What is different from other uses of @settings uses but not, I think, > difficult for newbies to grasp, is that you can use other settings to > specify a setting's value, e.g. > > @color solarized-red = #ffee00 > @color foreground-color = black > @color foreground-color-body = @foreground-color > @color foreground-color-log = @foreground-color > @color foreground-color-tree = @solarized-red > > Bear in mind that the newbie pathway to these will be a > menu ...Settings->Colors menu item which takes you to an organizer node > which explains what kind of values you can use (black or #1234ed etc.) > Good. > > For newbies / non-technical users, that's it, stop reading, you're > done. No mention of stylesheets. You use the ...Settings->Colors menu > item, you see some settings, edit them, and hit the reload style button. > > There's still some clean up to do, but that's how the current code's > supposed to work, and that seems to embody your alternative quite well. > I like it. > > Clean up is a mixture of replacing remaining literal constants (10px, > '#fde264', etc. in the stylesheet with a @<identifier> and putting the > @<identifier> in the regular Leo @settings space, and removing > remaining explicit widget coloring etc. in the code. > Cool. > > And little things like the docs. / instructions in @settings need to > explain that syntax coloring colors are different, "here's the list, > edit as needed, use only these color descriptors". > > Implementation wise, there's a Qt stylesheet, it contains @<identifer>s > which are replaced with the corresponding Leo @setting. > > Because long pieces of text aren't Leonine, the dark theme uses a tree > of nodes to author the stylesheet, and glues it together at "compile > time", i.e. when the user says to, after editing the tree. Because the > stylesheet only needs to be applied once, this could perhaps be done at > run time, but this whole tree authoring thing is a separate layer, not > a big deal. > > And as you see with @data qt-gui-user-style-sheet, people who do > understand Qt stylesheets can do whatever they want. > Yes. It's truly great. > > Also, there's the theme machinery, which basically means someone who > understands Qt stylesheets writes one to change more than can > represented with simple constants. What the theme code adds, beyond an > alternative stylesheet, is a theme name, which can be used to find > theme specific versions of icons, and also a flag to tell you if the > theme is dark or light, which might be useful information for > plugins etc. > Ok. So, if I understand you, everything will pretty much work as it does now. All we need is foolproof docs ;-) 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 http://groups.google.com/group/leo-editor. For more options, visit https://groups.google.com/groups/opt_out.