(This is a response to the invisible line glitch, but not directly
related, so a new thread)

Rember this:

http://groups.google.com/group/leo-editor/browse_thread/thread/ee869a0a70f2d765

Some time ago I was working on styling Leo from a single top level
stylesheet using a mechanism similar to CSS classes, so instead of:
    
    # widget is active
    w.setStyle("QTextEdit { color: red; font-weight: bold; }")
    
    ...
    
    # widget is inactive
    w.setStyle("QTextEdit { color: black; font-weight: normal; }")
    
you'd have

    # widget is active
    w.setAttribute('active', True)
    
    ...
    
    # widget is inactive
    w.setAttribute('active', False)

and in the single global style sheet

    QTextEdit[active="true"] { color: red; font-weight: bold; }
    QTextEdit[active="false"] { color: red; font-weight: bold; }

This isn't a perfect example because if active == focused then you
could probably just use the pseudo-state :focus and let Qt do all the
work, and also Leo would .setStyle() a string defined in @settings, not
something hard coded.

Qt styles are different from CSS in that CSS has a single attribute,
`class`, which can contain a space separated list of tags, whereas Qt
has arbitrary attributes like the `active` I just made up above.

Cheers -Terry

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/leo-editor?hl=en.

Reply via email to