From 289f989ec289169214460b8d54ebcfaf97e0487f Mon Sep 17 00:00:00 2001 From: Giovanni Gherdovich Date: Tue, 19 Oct 2010 18:17:30 +0200 Subject: [PATCH] fixed colouring on highlighted text for rspec viewer. Next: a good sizeHint --- sface/xmlwidget.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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) -- 2.43.0