From: Giovanni Gherdovich Date: Tue, 19 Oct 2010 16:17:30 +0000 (+0200) Subject: fixed colouring on highlighted text for rspec viewer. Next: a good sizeHint X-Git-Url: http://git.onelab.eu/?p=sface.git;a=commitdiff_plain;h=289f989ec289169214460b8d54ebcfaf97e0487f fixed colouring on highlighted text for rspec viewer. Next: a good sizeHint --- diff --git a/sface/xmlwidget.py b/sface/xmlwidget.py index b24de60..865f276 100644 --- a/sface/xmlwidget.py +++ b/sface/xmlwidget.py @@ -271,7 +271,7 @@ class ElemNodeDelegate(QAbstractItemDelegate): tmp = att.split('=') attName = tmp[0] attValue = tmp[1][1:-1] - AttListHtml += (nonHighAttPattern % (attName, attValue)) + AttListHtml += (attPattern % (attName, attValue)) html = (globPattern % (elemName, AttListHtml)) return html def colorize(color, text): @@ -281,6 +281,8 @@ class ElemNodeDelegate(QAbstractItemDelegate): if option.state & QStyle.State_Selected: htmlText = colorize(palette.highlightedText().color().name(), getHtmlText(text, highGlobPattern, highAttPattern)) + print htmlText + print getHtmlText(text, highGlobPattern, highAttPattern) document.setHtml(QString(htmlText)) else: htmlText = getHtmlText(text, nonHighGlobPattern, nonHighAttPattern)