On Sat, Oct 22, 2011 at 9:45 AM, Edward K. Ream <[email protected]> wrote:

> Still to do:
>
> - With solarized colors, we would like the foreground text of selected
> text to be exactly the same color as unselected (colorized) text.
>
>  This can not be done using the Qt Stylesheet alone: instead, Leo
> would have to define a custom role for highlightedText.

My initial efforts have failed.  Giving a role a new brush doesn't
work, because it seems that the stylesheet affects the new brush as
well as the old.  There may be an easy solution, but at present I have
no clue about what it is.  I may have to ask the Qt folks...

Edward

P.S.  Here is my experimental code in the ctor for the leoQtBody class:

    if 0: # xxx test: disable foreground color change for selected text.
            palette = qtWidget.palette()
            highlight_foreground_brush =
palette.brush(palette.Active,palette.HighlightedText) # white.
            highlight_background_brush =
palette.brush(palette.Active,palette.Highlight) # dark blue
            normal_brush = palette.brush(palette.Active,palette.Text)
            g.trace('foreground',highlight_foreground_brush.color().name())
            g.trace('background',highlight_background_brush.color().name())
            highlight_foreground_brush.setColor(QtGui.QColor('red'))
            g.trace('foreground',highlight_foreground_brush.color().name())
            palette.setBrush(palette.HighlightedText,highlight_foreground_brush)

The new name becomes red, but highlighted text is colored as before.

EKR

-- 
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